Python-language-server: Sub-packages of pandas do not appear

Created on 13 Jan 2020  路  7Comments  路  Source: microsoft/python-language-server

I don't know whether it's a bug or not, but please consider the following behavior:

pandas_sub_package

First, I import pandas and it all looks fine. Next, I want to type from pandas.io.json import json_normalize and it works nicely as well. Lastly, I want to try pd.io.json.json_normalize directly, and this is where the behavior is unfriendly. The LS doesn't find neither io nor json when I start typing pd..

So, is this a bug or an expected behavior? If it's neither, how can I workaround it?

bug intellisense

All 7 comments

This is b/c pandas has io submodule and hence pandas.io works in import statement completion. However, __init__.py does not directly import io and only has from pandas.io.api .... So io does not appear in exported items. I guess submodules should be added there too.

What __init__.py are you referring to?

The one in site-packages/pandas folder.

So is this a pandas bug??

No, LS completion issue. I think submodules should appear in the list even if not explicitly imported.

@MikhailArkhipov Can it be that a similar problem happens with numpy.testing?

Unfortunately, change regressed more than it fixed. Reverting, needs more work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dschiller picture dschiller  路  5Comments

rpedrodasilva10 picture rpedrodasilva10  路  4Comments

mostafaeweda picture mostafaeweda  路  6Comments

luanft picture luanft  路  3Comments

Jma353 picture Jma353  路  3Comments