Skip to content

Commit ca5c639

Browse files
add ignore_missing_imports=False
1 parent f8a924b commit ca5c639

File tree

139 files changed

+611
-291
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+611
-291
lines changed

pandas/_libs/tslibs/__init__.py

+18-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
# flake8: noqa
22

3-
from .conversion import localize_pydatetime, normalize_date
4-
from .nattype import NaT, NaTType, iNaT, is_null_datetimelike
5-
from .np_datetime import OutOfBoundsDatetime
6-
from .period import IncompatibleFrequency, Period
7-
from .timedeltas import Timedelta, delta_to_nanoseconds, ints_to_pytimedelta
8-
from .timestamps import Timestamp
9-
from .tzconversion import tz_convert_single
3+
# error: No library stub file for module 'pandas._libs.tslibs.conversion'
4+
# error: No library stub file for module 'pandas._libs.tslibs.nattype'
5+
# error: No library stub file for module 'pandas._libs.tslibs.np_datetime'
6+
# error: No library stub file for module 'pandas._libs.tslibs.period'
7+
# error: No library stub file for module 'pandas._libs.tslibs.timedeltas'
8+
# error: No library stub file for module 'pandas._libs.tslibs.timestamps'
9+
# error: No library stub file for module 'pandas._libs.tslibs.tzconversion'
10+
from .conversion import localize_pydatetime, normalize_date # type: ignore
11+
from .nattype import NaT, NaTType, iNaT, is_null_datetimelike # type: ignore
12+
from .np_datetime import OutOfBoundsDatetime # type: ignore
13+
from .period import IncompatibleFrequency, Period # type: ignore
14+
from .timedeltas import ( # type: ignore
15+
Timedelta,
16+
delta_to_nanoseconds,
17+
ints_to_pytimedelta,
18+
)
19+
from .timestamps import Timestamp # type: ignore
20+
from .tzconversion import tz_convert_single # type: ignore

pandas/_typing.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
from pathlib import Path
22
from typing import IO, TYPE_CHECKING, AnyStr, Optional, TypeVar, Union
33

4-
import numpy as np
4+
# error: No library stub file for module 'numpy'
5+
import numpy as np # type: ignore
56

67
# To prevent import cycles place any internal imports in the branch below
78
# and use a string literal forward reference to it in subsequent types

pandas/api/types/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
""" public toolkit API """
22

3-
from pandas._libs.lib import infer_dtype # noqa: F401
3+
# error: No library stub file for module 'pandas._libs.lib'
4+
from pandas._libs.lib import infer_dtype # type: ignore # noqa: F401
45

56
from pandas.core.dtypes.api import * # noqa: F403, F401
67
from pandas.core.dtypes.concat import union_categoricals # noqa: F401

pandas/compat/numpy/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
from distutils.version import LooseVersion
44
import re
55

6-
import numpy as np
6+
# error: No library stub file for module 'numpy'
7+
import numpy as np # type: ignore
78

89
# numpy versioning
910
_np_version = np.__version__

pandas/compat/numpy/function.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@
2121
from distutils.version import LooseVersion
2222
from typing import Any, Dict, Optional, Union
2323

24-
from numpy import __version__ as _np_version, ndarray
24+
# error: No library stub file for module 'numpy'
25+
from numpy import __version__ as _np_version, ndarray # type: ignore
2526

26-
from pandas._libs.lib import is_bool, is_integer
27+
# error: No library stub file for module 'pandas._libs.lib'
28+
from pandas._libs.lib import is_bool, is_integer # type: ignore
2729
from pandas.errors import UnsupportedFunctionCall
2830
from pandas.util._validators import (
2931
validate_args,

pandas/core/algorithms.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
from typing import Dict
77
from warnings import catch_warnings, simplefilter, warn
88

9-
import numpy as np
9+
# error: No library stub file for module 'numpy'
10+
import numpy as np # type: ignore
1011

12+
# error: No library stub file for module 'pandas._libs.tslib'
1113
from pandas._libs import algos, hashtable as htable, lib
12-
from pandas._libs.tslib import iNaT
14+
from pandas._libs.tslib import iNaT # type: ignore
1315
from pandas.util._decorators import Appender, Substitution, deprecate_kwarg
1416

1517
from pandas.core.dtypes.cast import (

pandas/core/api.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# flake8: noqa
22

3-
import numpy as np
3+
# error: No library stub file for module 'numpy'
4+
import numpy as np # type: ignore
45

56
from pandas.core.dtypes.dtypes import (
67
CategoricalDtype,

pandas/core/apply.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import inspect
22
import warnings
33

4-
import numpy as np
4+
# error: No library stub file for module 'numpy'
5+
import numpy as np # type: ignore
56

67
from pandas._libs import reduction as libreduction
78
from pandas.util._decorators import cache_readonly

pandas/core/arrays/_ranges.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55

66
from typing import Tuple
77

8-
import numpy as np
8+
# No library stub file for module 'numpy'
9+
import numpy as np # type: ignore
910

1011
from pandas._libs.tslibs import OutOfBoundsDatetime, Timestamp
1112

pandas/core/arrays/base.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
import operator
99
from typing import Any, Callable, Dict, Optional, Sequence, Tuple, Union
1010

11-
import numpy as np
11+
# error: No library stub file for module 'numpy'
12+
import numpy as np # type: ignore
1213

1314
from pandas.compat import set_function_name
1415
from pandas.compat.numpy import function as nv

pandas/core/arrays/categorical.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
from typing import Type, Union, cast
55
from warnings import warn
66

7-
import numpy as np
7+
# error: No library stub file for module 'numpy'
8+
import numpy as np # type: ignore
89

910
from pandas._config import get_option
1011

pandas/core/arrays/datetimelike.py

+17-5
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,25 @@
33
from typing import Any, Sequence, Type, Union, cast
44
import warnings
55

6-
import numpy as np
6+
# error: No library stub file for module 'numpy'
7+
import numpy as np # type: ignore
78

9+
# error: No library stub file for module 'pandas._libs.tslibs.c_timestamp'
10+
# error: No library stub file for module 'pandas._libs.tslibs.period'
11+
# error: No library stub file for module 'pandas._libs.tslibs.timedeltas'
12+
# error: No library stub file for module 'pandas._libs.tslibs.timestamps'
813
from pandas._libs import NaT, NaTType, Timestamp, algos, iNaT, lib
9-
from pandas._libs.tslibs.c_timestamp import maybe_integer_op_deprecated
10-
from pandas._libs.tslibs.period import DIFFERENT_FREQ, IncompatibleFrequency, Period
11-
from pandas._libs.tslibs.timedeltas import Timedelta, delta_to_nanoseconds
12-
from pandas._libs.tslibs.timestamps import RoundTo, round_nsint64
14+
from pandas._libs.tslibs.c_timestamp import maybe_integer_op_deprecated # type: ignore
15+
from pandas._libs.tslibs.period import ( # type:ignore
16+
DIFFERENT_FREQ,
17+
IncompatibleFrequency,
18+
Period,
19+
)
20+
from pandas._libs.tslibs.timedeltas import ( # type: ignore
21+
Timedelta,
22+
delta_to_nanoseconds,
23+
)
24+
from pandas._libs.tslibs.timestamps import RoundTo, round_nsint64 # type: ignore
1325
from pandas.compat.numpy import function as nv
1426
from pandas.errors import AbstractMethodError, NullFrequencyError, PerformanceWarning
1527
from pandas.util._decorators import Appender, Substitution

pandas/core/arrays/datetimes.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
from typing import Union
44
import warnings
55

6-
import numpy as np
6+
# error: No library stub file for module 'numpy'
7+
import numpy as np # type: ignore
78
from pytz import utc
89

910
from pandas._libs import lib, tslib

pandas/core/arrays/integer.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
from typing import Type
33
import warnings
44

5-
import numpy as np
5+
# error: No library stub file for module 'numpy'
6+
import numpy as np # type: ignore
67

78
from pandas._libs import lib
89
from pandas.compat import set_function_name

pandas/core/arrays/interval.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
from operator import le, lt
22
import textwrap
33

4-
import numpy as np
4+
# error: No library stub file for module 'numpy'
5+
import numpy as np # type: ignore
56

67
from pandas._config import get_option
78

8-
from pandas._libs.interval import Interval, IntervalMixin, intervals_to_interval_bounds
9+
# error: No library stub file for module 'pandas._libs.interval'
10+
from pandas._libs.interval import ( # type: ignore
11+
Interval,
12+
IntervalMixin,
13+
intervals_to_interval_bounds,
14+
)
915
from pandas.compat.numpy import function as nv
1016
from pandas.util._decorators import Appender
1117

pandas/core/arrays/numpy_.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import numbers
22

3-
import numpy as np
4-
from numpy.lib.mixins import NDArrayOperatorsMixin
3+
# error: No library stub file for module 'numpy'
4+
# error: No library stub file for module 'numpy.lib.mixins'
5+
import numpy as np # type: ignore
6+
from numpy.lib.mixins import NDArrayOperatorsMixin # type: ignore
57

68
from pandas._libs import lib
79
from pandas.compat.numpy import function as nv

pandas/core/arrays/period.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22
import operator
33
from typing import Any, Callable, List, Optional, Sequence, Union
44

5-
import numpy as np
5+
# error: No library stub file for module 'numpy'
6+
import numpy as np # type: ignore
67

8+
# error: No library stub file for module 'pandas._libs.tslibs.fields'
9+
# error: No library stub file for module 'pandas._libs.tslibs.period'
10+
# error: No library stub file for module 'pandas._libs.tslibs.timedeltas'
711
from pandas._libs import lib
812
from pandas._libs.tslibs import (
913
NaT,
@@ -12,15 +16,18 @@
1216
iNaT,
1317
period as libperiod,
1418
)
15-
from pandas._libs.tslibs.fields import isleapyear_arr
16-
from pandas._libs.tslibs.period import (
19+
from pandas._libs.tslibs.fields import isleapyear_arr # type: ignore
20+
from pandas._libs.tslibs.period import ( # type: ignore
1721
DIFFERENT_FREQ,
1822
IncompatibleFrequency,
1923
Period,
2024
get_period_field_arr,
2125
period_asfreq_arr,
2226
)
23-
from pandas._libs.tslibs.timedeltas import Timedelta, delta_to_nanoseconds
27+
from pandas._libs.tslibs.timedeltas import ( # type: ignore
28+
Timedelta,
29+
delta_to_nanoseconds,
30+
)
2431
import pandas.compat as compat
2532
from pandas.util._decorators import Appender, cache_readonly
2633

pandas/core/arrays/sparse.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
from typing import Any, Callable
99
import warnings
1010

11-
import numpy as np
11+
# error: No library stub file for module 'numpy'
12+
import numpy as np # type: ignore
1213

14+
# error: No library stub file for module 'pandas._libs.sparse'
1315
from pandas._libs import index as libindex, lib
14-
import pandas._libs.sparse as splib
16+
import pandas._libs.sparse as splib # type: ignore
1517
from pandas._libs.sparse import BlockIndex, IntIndex, SparseIndex
1618
from pandas._libs.tslibs import NaT
1719
import pandas.compat as compat
@@ -2205,7 +2207,8 @@ def to_coo(self):
22052207
and uint64 will result in a float64 dtype.
22062208
"""
22072209
import_optional_dependency("scipy")
2208-
from scipy.sparse import coo_matrix
2210+
# error: No library stub file for module 'scipy.sparse'
2211+
from scipy.sparse import coo_matrix # type: ignore
22092212

22102213
dtype = find_common_type(self._parent.dtypes)
22112214
if isinstance(dtype, SparseDtype):

pandas/core/arrays/timedeltas.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
from typing import List
44
import warnings
55

6-
import numpy as np
6+
# error: No library stub file for module 'numpy'
7+
import numpy as np # type: ignore
78

9+
# error: No library stub file for module 'pandas._libs.tslibs.fields'
10+
# error: No library stub file for module 'pandas._libs.tslibs.timedeltas'
811
from pandas._libs import lib, tslibs
912
from pandas._libs.tslibs import NaT, Timedelta, Timestamp, iNaT
10-
from pandas._libs.tslibs.fields import get_timedelta_field
11-
from pandas._libs.tslibs.timedeltas import (
13+
from pandas._libs.tslibs.fields import get_timedelta_field # type: ignore
14+
from pandas._libs.tslibs.timedeltas import ( # type: ignore
1215
array_to_timedelta64,
1316
parse_timedelta_unit,
1417
precision_from_unit,

pandas/core/base.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
from typing import Dict, Optional
88
import warnings
99

10-
import numpy as np
10+
# error: No library stub file for module 'numpy'
11+
import numpy as np # type: ignore
1112

12-
import pandas._libs.lib as lib
13+
# error: No library stub file for module 'pandas._libs.lib'
14+
import pandas._libs.lib as lib # type: ignore
1315
from pandas.compat import PYPY
1416
from pandas.compat.numpy import function as nv
1517
from pandas.errors import AbstractMethodError

pandas/core/common.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
import inspect
1212
from typing import Any, Iterable, Union
1313

14-
import numpy as np
14+
# error: No library stub file for module 'numpy'
15+
import numpy as np # type: ignore
1516

1617
from pandas._libs import lib, tslibs
1718
from pandas.compat import PY36

pandas/core/computation/align.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
from functools import partial, wraps
55
import warnings
66

7-
import numpy as np
7+
# error: No library stub file for module 'numpy'
8+
import numpy as np # type: ignore
89

910
from pandas.errors import PerformanceWarning
1011

pandas/core/computation/common.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from functools import reduce
22

3-
import numpy as np
3+
# error: No library stub file for module 'numpy'
4+
import numpy as np # type: ignore
45

56
from pandas._config import get_option
67

pandas/core/computation/engines.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ def convert(self):
108108
return str(super().convert())
109109

110110
def _evaluate(self):
111-
import numexpr as ne
111+
# error: Cannot find module named 'numexpr'
112+
import numexpr as ne # type: ignore
112113

113114
# convert the expression to a valid numexpr expression
114115
s = self.convert()

pandas/core/computation/expr.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
import tokenize
1010
from typing import Type
1111

12-
import numpy as np
12+
# error: No library stub file for module 'numpy'
13+
import numpy as np # type: ignore
1314

1415
import pandas as pd
1516
from pandas.core import common as com

pandas/core/computation/expressions.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,21 @@
88

99
import warnings
1010

11-
import numpy as np
11+
# error: No library stub file for module 'numpy'
12+
import numpy as np # type: ignore
1213

1314
from pandas._config import get_option
1415

15-
from pandas._libs.lib import values_from_object
16+
# error: No library stub file for module 'pandas._libs.lib'
17+
from pandas._libs.lib import values_from_object # type: ignore
1618

1719
from pandas.core.dtypes.generic import ABCDataFrame
1820

1921
from pandas.core.computation.check import _NUMEXPR_INSTALLED
2022

2123
if _NUMEXPR_INSTALLED:
22-
import numexpr as ne
24+
# error: Cannot find module named 'numexpr'
25+
import numexpr as ne # type: ignore
2326

2427
_TEST_MODE = None
2528
_TEST_RESULT = None

pandas/core/computation/ops.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
from functools import partial
77
import operator as op
88

9-
import numpy as np
9+
# error: No library stub file for module 'numpy'
10+
import numpy as np # type: ignore
1011

1112
from pandas._libs.tslibs import Timestamp
1213

0 commit comments

Comments
 (0)