You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd brought up some time ago that autocomplete / tab-complete is unreliable in IPython. I thought this might have been due to limitations in recognising namespaces (like .dt). However, comparing with the much simpler Narwhals, that seems to not the case:
Let's see what happens if I type pl.col('a').dt.to - what's suggested?
demo from IPython:
Narwhals (correct suggestion):
Polars (incorrect suggestion):
From nvim (with pylsp):
Narwhals (correct suggestion):
Polars (no suggestion):
I suspect (though haven't yet been able to verify) that some of the magic dispatch mechanisms in Polars may be to blame? They work fine at runtime, but mess up editors
If that's the case, then I'd advocate for drastically simplifying things on the Python Polars side - if that means copy-and-pasting a few definitions, then OK, so be it. But in terms of user adoption, a better user experience with auto-complete would really pay dividends
Note that the namespaces aren't the only cases where the discrepancy appears. I won't post screenshots, but you can verify that typing pl.col('a').fi / nw.col('a').fi gives:
IPython:
Narwhals: suggests fill_null and filter
Polars: no suggestion EDIT: this is now fixed in Polars (but the pl.col('a').dt.to issue is still present!)
nvim:
this works for both 👍
A solution could be to say that IPython and pylsp are wrong...but given how many users they have (especially the former, almost the whole data science world uses some variation of it...) I think it'd be a pity
The text was updated successfully, but these errors were encountered:
Yeah pylance seems more advanced. As much as I'd like to say "everyone should just use vscode or pycharm", people don't necessarily have control over what they use (especially at work)
Description
I'd brought up some time ago that autocomplete / tab-complete is unreliable in IPython. I thought this might have been due to limitations in recognising namespaces (like
.dt
). However, comparing with the much simpler Narwhals, that seems to not the case:Let's see what happens if I type
pl.col('a').dt.to
- what's suggested?demo from IPython:
Narwhals (correct suggestion):
Polars (incorrect suggestion):
From nvim (with pylsp):
Narwhals (correct suggestion):
Polars (no suggestion):
I suspect (though haven't yet been able to verify) that some of the magic dispatch mechanisms in Polars may be to blame? They work fine at runtime, but mess up editors
If that's the case, then I'd advocate for drastically simplifying things on the Python Polars side - if that means copy-and-pasting a few definitions, then OK, so be it. But in terms of user adoption, a better user experience with auto-complete would really pay dividends
Note that the namespaces aren't the only cases where the discrepancy appears. I won't post screenshots, but you can verify that typing
pl.col('a').fi
/nw.col('a').fi
gives:fill_null
andfilter
pl.col('a').dt.to
issue is still present!)A solution could be to say that IPython and pylsp are wrong...but given how many users they have (especially the former, almost the whole data science world uses some variation of it...) I think it'd be a pity
The text was updated successfully, but these errors were encountered: