-
-
Notifications
You must be signed in to change notification settings - Fork 512
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
IPython TAB-completion now shows deprecation warnings (pandas) #1383
Comments
We had this once before (when IPython started to use Jedi): pandas-dev/pandas#16409 (which links to ipython/ipython#9094, which seems to indicate that this was then fixed in Jedi), and then we also did some change in pandas to workaround it: pandas-dev/pandas#16414 |
This is probably fixable. We should probably catch all warnings when properties are queried. I mean essentially we catch all exceptions, so why not catch warnings as well. :) |
At the library level, we could really use a way to prevent jedi from trying to access properties, not just silencing warnings. In h5py, there's a |
In this particular case, it's a deprecated attribute anyway, so I've just hidden it from completions with a custom |
@takluyver Do you have an idea how we could do that? I assume |
Yes, I'd imagine libraries could do something like this: class Dataset:
properties_no_auto = ('value',)
@property
def value(self):
... This is no longer pressing for our use case - the problematic property is gone in master, and we have a workaround for stable branches. But it might come up for other libraries. |
I don't know anything about the implemenation of jedi, so this might be dummy question. As I understood from the other issues that I linked, the main problem was with "chained" completions no longer working. So eg
in case the property returns a new object that has properties/methods to be tab completed. And for me the above case is really useful (I also opened one of those issues). But while for the above it is needed to execute
Or is it difficult for Jedi to distinguish those cases? |
@jorisvandenbossche It would be possible to distinguish those cases, it would just be a bit of work, because it's currently not implemented like that. So if anyone volunteers to do it, I'm happy to help :) Thanks for this idea! I didn't even think about that, because it doesn't really solve the problem. It will however help a lot of users to not run into this issue anymore, which might just be enough. |
I know this might be the consequence of fixing #1299, but reporting anyway: while trying out the latest jedi 0.15.1, I see a bunch of deprecation warnings when tab-completing on a pandas Series in IPython (with latest pandas release 0.25.0):
(the warnings end up before the
In [5]
block in the output, but they are from triggering the TAB)The text was updated successfully, but these errors were encountered: