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(python): additional autocomplete affordances for IPython users #5477

Merged
merged 1 commit into from
Nov 11, 2022
Merged

feat(python): additional autocomplete affordances for IPython users #5477

merged 1 commit into from
Nov 11, 2022

Conversation

alexander-beedie
Copy link
Collaborator

@alexander-beedie alexander-beedie commented Nov 11, 2022

Closes #5468.


Implements special _ipython_key_completions_ method, enabling autocomplete suggestions in IPython for polars DataFrame columns and Series.struct fields:

…frame and struct cols available via __getitem__)
@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars labels Nov 11, 2022
@ritchie46
Copy link
Member

ritchie46 commented Nov 11, 2022

That's really nice. Would this be possible for pl.col(".. as well?

EDIT:

I don't think so, it is hard to know the context we use statically.

@alexander-beedie
Copy link
Collaborator Author

alexander-beedie commented Nov 11, 2022

it is hard to know the context we use statically.

Exactly - the col object is isolated from the frame context it'll be used in (and the magic method only applies to dict-style __getitem__ lookup, eg: obj['<str>...). Was looking for other opportunities to deploy it - at least I found struct, heh.

@ritchie46 ritchie46 merged commit 57dd31c into pola-rs:master Nov 11, 2022
@alexander-beedie alexander-beedie deleted the ipython-autocomplete branch November 11, 2022 18:47
zundertj pushed a commit to zundertj/polars that referenced this pull request Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or an improvement of an existing feature python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add _ipython_key_completions_ method to DataFrame
2 participants