Open
Description
Bug description
Repro:
-
mkdir test && cd test
-
python3 -m venv venv
-
venv/bin/pip install pylint pandas
-
Write
foo.py
:from dataclasses import dataclass from pandas import DataFrame @dataclass class Foo: a: DataFrame
-
time pylint --disable=all foo.py
And this consistently takes 8s to run on my machine. Doing any of the following brings the runtime down to <2s:
- Comment out the
dataclasses
import - Comment out the
pandas
import - Comment out the
@dataclass
decorator - Use
@foo
instead of@dataclass
- Use
@dataclasses.dataclass
instead of@dataclass
- Use
int
instead ofpandas.Series
- Use
Optional[DataFrame]
instead ofDataFrame
- Uninstalling
pandas
from the environment
Configuration
No response
Command used
time pylint --disable=all foo.py
Pylint output
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
--disable=all foo.py 7.93s user 0.28s system 111% cpu 7.387 total
Expected behavior
Disabling all checks should not take 8 seconds for this small file.
Pylint version
pylint 2.12.2
astroid 2.9.3
Python 3.9.7 (default, Sep 3 2021, 12:45:31)
[Clang 12.0.0 (clang-1200.0.32.29)]
OS / Environment
OSX 10.15 (Catalina)
Additional dependencies
astroid==2.9.3
isort==5.10.1
lazy-object-proxy==1.7.1
mccabe==0.6.1
numpy==1.22.2
pandas==1.4.1
platformdirs==2.5.1
pylint==2.12.2
python-dateutil==2.8.2
pytz==2021.3
six==1.16.0
toml==0.10.2
typing_extensions==4.1.1
wrapt==1.13.3