Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Improved expression autocomplete for IPython, Jupyter, and Marimo #22221

Merged
merged 1 commit into from
Apr 11, 2025

Conversation

alexander-beedie
Copy link
Collaborator

@alexander-beedie alexander-beedie commented Apr 11, 2025

Closes #16933 (and #20496).

Ref: marimo-team/marimo#3302
Ref: davidhalter/jedi#2057

Thanks to some very helpful analysis by @krassowski, the exact mechanism that causes Jedi/Parso-based autocomplete (eg: as found in IPython, Jupyter, and Marimo) to fail for Polars' namespaced expression methods was identified.

With the new info in mind, I was able to craft a small workaround to solve it on our side.
"Our long national autocomplete nightmare is over..."1 ✌️😎

(Note: everything was already fine in the major editors such as PyCharm and VSCode, as well as anything using pylance on the backend for LSP/autocomplete).

Before

IPython:

image

Marimo:

image

After

IPython:

image

Marimo:

image

Footnotes

  1. Ref: the inauguration of Gerald Ford, remarks

@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars labels Apr 11, 2025
@alexander-beedie alexander-beedie changed the title feat: Improved expression autocomplete for IPython (and other envs) feat: Improved expression autocomplete for IPython (and other notebook/dev environments) Apr 11, 2025
@alexander-beedie alexander-beedie changed the title feat: Improved expression autocomplete for IPython (and other notebook/dev environments) feat: Improved expression autocomplete for IPython (and other notebook/dev environments) Apr 11, 2025
@alexander-beedie alexander-beedie force-pushed the improve-autocomplete-ux branch from 7f83b92 to 69dfa02 Compare April 11, 2025 07:45
@alexander-beedie alexander-beedie changed the title feat: Improved expression autocomplete for IPython (and other notebook/dev environments) feat: Improved expression autocomplete for IPython and Marimo Apr 11, 2025
@ritchie46
Copy link
Member

Wow! Super nice!

Copy link

codecov bot commented Apr 11, 2025

Codecov Report

Attention: Patch coverage is 33.33333% with 6 lines in your changes missing coverage. Please review.

Project coverage is 81.15%. Comparing base (999812e) to head (69dfa02).
Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
py-polars/polars/expr/expr.py 33.33% 2 Missing ⚠️
py-polars/polars/series/series.py 33.33% 2 Missing ⚠️
py-polars/polars/series/struct.py 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #22221      +/-   ##
==========================================
+ Coverage   80.59%   81.15%   +0.55%     
==========================================
  Files        1640     1638       -2     
  Lines      236814   235253    -1561     
  Branches     2714     2714              
==========================================
+ Hits       190871   190911      +40     
+ Misses      45302    43701    -1601     
  Partials      641      641              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alexander-beedie alexander-beedie added the A-ide Area: interaction with IDE software label Apr 11, 2025
@ritchie46 ritchie46 merged commit a7c7606 into pola-rs:main Apr 11, 2025
27 checks passed
@alexander-beedie alexander-beedie deleted the improve-autocomplete-ux branch April 11, 2025 08:34
@alexander-beedie alexander-beedie changed the title feat: Improved expression autocomplete for IPython and Marimo feat: Improved expression autocomplete for IPython, Jupyter, and Marimo Apr 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ide Area: interaction with IDE software enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Simplify expressions definition to enable better auto-complete in IPython + nvim
2 participants