-
Notifications
You must be signed in to change notification settings - Fork 767
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
Issue with DataFrame.rename and the columns named argument #71
Comments
Thanks for the bug report. @gramster, this looks like a bug in the pandas type stub? As for the error, I've changed the diagnostics related to argument/parameter matching to be suppressed when type checking mode is disabled. This change will be in the next version of Pylance. |
Yes, that stub is an older one from when a single scaler ‘by’ argument
would return a SeriesGroupBy. That is no longer true and the overload
should be removed. Will fix it tomorrow.
…On Tue, Jul 7, 2020 at 9:41 PM Eric Traut ***@***.***> wrote:
Thanks for the bug report.
@gramster <https://github.com/gramster>, this looks like a bug in the
pandas type stub?
As for the error, I've changed the diagnostics related to
argument/parameter matching to be suppressed when type checking mode is
disabled. This change will be in the next version of Pylance.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#71 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAVCPCBVZS4I4H3DJBXUGDDR2P2HZANCNFSM4OUEM73A>
.
|
Pylance also infer the below code incorrectly: import pandas as pd
df = pd.DataFrame({"a": [1, 2, 3]})
print(df.fillna("")) # Error: No overloads for "df.fillna("")" match parameters |
@gramster, this looks like a bug in the pandas type stub. The To re-export a symbol from a type stub, you need to use the "as" syntax (as per PEP 484). Something like this...
|
That's #13 (but not fixed). |
This issue has been fixed in version 2020.7.0, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#202070-9-july-2020 |
Environment data
Expected behaviour
When using df.rename() and passing columns as a named argument, no error is raised as this is per the documentation:
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.rename.html
Actual behaviour
Pylance shows an error saying no parameter named "columns". I've recreated the issue in the code below. It seems to have something to do with using groupby which leads Pylance to believe the DataFrame is a Series object
Code Snippet / Additional information
The text was updated successfully, but these errors were encountered: