-
Notifications
You must be signed in to change notification settings - Fork 596
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: Intellisense for the underscore table accessor #10369
Comments
I have wanted the same thing :). Unfortunatley, I don't think this will ever be possible, since the meaning of _ depends entirely on the context that it is used, which I don't think can be known statically by an analysis tool like mypy/pyright, etc. At the least, it would require some VERY deep knowledge of python's type system. I wouldn't hold my breath for this |
I actually made some progress on this, but I'm not yet sure whether it's a viable approach. The trickiest bit here for a proof of concept is partial parsing of Python syntax. I remembered (not sure from where) that tree-sitter can handle partial parsing of programming languages, so I spent some time looking into combining tree sitter with the IPython completion mechanism. First, tree sitter was actually pretty straightforward to use to get the information I want for very simple expressions. Second, the IPython completion customization hooks leave something to be desired, but I was able to get I haven't figured out a few things:
In any event, here's a screenshot and a gist with the code: |
FWIW, I suspect this is doable in a way that is both complete enough to be valuable, and not interfere with existing completions. The second part, not interfering with existing completions is likely going to require some spelunking in IPython to figure out how to delegate to the default behavior when the Ibis completion doesn't match anything. |
Is your feature request related to a problem?
No response
What is the motivation behind your request?
No response
Describe the solution you'd like
I'm using vscode with Python/Pylance extension installed. Here's my example with a table created off of a postgres connection:
my_tab = con.table("my_tab")
isin
):my_tab.filter(my_tab.my_col.
my_tab.filter(_.my_col.
It would be awesome if the latter worked for intellisense in the IDE.
What version of ibis are you running?
9.5.0
What backend(s) are you using, if any?
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: