-
Notifications
You must be signed in to change notification settings - Fork 771
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
Pylance does not show me the docstring for the to_csv()
method
#550
Comments
I don't think this should be a "bundled typestub bug". That should only be the case if the docstring is computed and not statically declared. In this case, the docstring is available; the method is inherited from NDFrame and the docstring is at https://github.com/pandas-dev/pandas/blob/639a9c27964b09724a0ae2acdd0e6a10e49ddd88/pandas/core/generic.py#L3228. Pylance should be finding it. I am removing the label. |
This issue has been fixed in version 2021.3.0, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202130-3-march-2021 |
Pylance still regularly thinks it should resolve an NDFrame while it shouldn't.
b is of inferred by pyright as The type stubs (right click: "Go to Declaration"), however, will show the method should return a Now I have NDFrames all over my code where the stubs are broken basically. Because pylance will complaint that I cannot use basic dataframe methods because they are not implemented on the So I dug a little bit and found it NDFrame is implemented as an abstract class and thus has no return type. I think the stubs are a not correctly generated with these abstract classes Pandas is using? Pyright should not infer abstract classes as return types. Btw, trying to "cast" the NDFrames manually to a DataFrame or Series doesn't work either:
Using pandas 1.3.4 btw. |
@karthiknadig Thanks, I gave it a try but it does not yet look ready for prime to me. Without going into detail, Pylance does not show me the docstring for the
to_csv()
method while hovering in the following example whereas the default Python language server can do this:Feel free to create an issue for this if Pylance should be able to support this. :-)
Originally posted by @LinqLover in microsoft/vscode-python#13013 (comment)
The text was updated successfully, but these errors were encountered: