-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
False positive of unused-import since v2.15.0 #7506
Comments
Thank you @yilei. I can reproduce on the latest version of Pylint/astroid & also see no false positive on Pylint==2.14.5: pylint 2.16.0-dev
astroid 2.12.10
Python 3.10.4 |
We knew there was a risk of causing this false positive in pylint-dev/astroid#1622, but I thought we checked that we handled it (I suppose not). Closely related to #1630 (might need to broaden that issue title back out). |
Should this be fixed in |
I think it's a pylint problem. |
Maybe a similar issue with pandas_ta: import pandas as pd
# https://github.com/twopirllc/pandas-ta
import pandas_ta as ta
df = pd.read_csv('data.csv')
df.ta.ad() produces: |
This should be relevant: pylint-dev/astroid#1735 |
Harden support for using enums as metaclasses. Fixes the crash in pylint-dev/pylint#5935 by adopting the check for not-none bases as in ClassDef._inferred_bases without recausing the false positive reported in pylint-dev/pylint#7506, which requires correct bases.
Turns out it was an astroid problem. Regression test PR coming shortly, will fail until upgrading astroid. |
Harden support for using enums as metaclasses. Fixes the crash in pylint-dev/pylint#5935 by adopting the check for not-none bases as in ClassDef._inferred_bases without recausing the false positive reported in pylint-dev/pylint#7506, which requires correct bases.
…s` (#2049) Harden support for using enums as metaclasses. Fixes the crash in pylint-dev/pylint#5935 by adopting the check for not-none bases as in ClassDef._inferred_bases without recausing the false positive reported in pylint-dev/pylint#7506, which requires correct bases.
…s` (#2049) Harden support for using enums as metaclasses. Fixes the crash in pylint-dev/pylint#5935 by adopting the check for not-none bases as in ClassDef._inferred_bases without recausing the false positive reported in pylint-dev/pylint#7506, which requires correct bases. (cherry picked from commit b5ebf99)
…s` (#2049) (#2067) Harden support for using enums as metaclasses. Fixes the crash in pylint-dev/pylint#5935 by adopting the check for not-none bases as in ClassDef._inferred_bases without recausing the false positive reported in pylint-dev/pylint#7506, which requires correct bases. (cherry picked from commit b5ebf99) Co-authored-by: Jacob Walls <[email protected]>
* Add regression test for #7506 (#8432) (cherry picked from commit 1fa16c2) --------- Co-authored-by: Pierre Sassoulas <[email protected]> Co-authored-by: Jacob Walls <[email protected]>
Bug description
Given the following code:
Configuration
No response
Command used
Pylint output
************* Module t t.py:4:0: W0611: Unused import six (unused-import) ------------------------------------------------------------------ Your code has been rated at 7.50/10 (previous run: 2.50/10, +5.00)
Expected behavior
No
unused-import
should be raisedPylint version
This cannot be reproduced in v2.14.5.
The text was updated successfully, but these errors were encountered: