Skip to content

Commit 9bf58b5

Browse files
committed
enable reportUnknownVariableType
1 parent 7c90b93 commit 9bf58b5

Some content is hidden

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

73 files changed

+843
-721
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ repos:
1818
hooks:
1919
- id: isort
2020
- repo: https://github.com/psf/black
21-
rev: 25.9.0
21+
rev: 25.11.0
2222
hooks:
2323
- id: black

pandas-stubs/__init__.pyi

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,17 @@ from pandas.core.api import (
6161
timedelta_range as timedelta_range,
6262
to_datetime as to_datetime,
6363
to_numeric as to_numeric,
64-
to_timedelta as to_timedelta,
6564
unique as unique,
6665
)
66+
from pandas.core.api import (
67+
to_timedelta as to_timedelta, # pyright: ignore[reportUnknownVariableType]
68+
)
6769
from pandas.core.arrays.sparse import SparseDtype as SparseDtype
68-
from pandas.core.computation.api import eval as eval
70+
from pandas.core.computation.api import (
71+
eval as eval, # pyright: ignore[reportUnknownVariableType]
72+
)
6973
from pandas.core.reshape.api import (
7074
concat as concat,
71-
crosstab as crosstab,
72-
cut as cut,
7375
from_dummies as from_dummies,
7476
get_dummies as get_dummies,
7577
lreshape as lreshape,
@@ -78,10 +80,18 @@ from pandas.core.reshape.api import (
7880
merge_asof as merge_asof,
7981
merge_ordered as merge_ordered,
8082
pivot as pivot,
81-
pivot_table as pivot_table,
8283
qcut as qcut,
8384
wide_to_long as wide_to_long,
8485
)
86+
from pandas.core.reshape.api import (
87+
crosstab as crosstab, # pyright: ignore[reportUnknownVariableType]
88+
)
89+
from pandas.core.reshape.api import (
90+
cut as cut, # pyright: ignore[reportUnknownVariableType]
91+
)
92+
from pandas.core.reshape.api import (
93+
pivot_table as pivot_table, # pyright: ignore[reportUnknownVariableType]
94+
)
8595

8696
from pandas._config import (
8797
describe_option as describe_option,
@@ -98,27 +108,49 @@ from pandas.io.api import (
98108
ExcelFile as ExcelFile,
99109
ExcelWriter as ExcelWriter,
100110
HDFStore as HDFStore,
101-
read_clipboard as read_clipboard,
102-
read_csv as read_csv,
103-
read_excel as read_excel,
104111
read_feather as read_feather,
105112
read_fwf as read_fwf,
106113
read_hdf as read_hdf,
107-
read_html as read_html,
108114
read_json as read_json,
109-
read_orc as read_orc,
110-
read_parquet as read_parquet,
111115
read_pickle as read_pickle,
112116
read_sas as read_sas,
113117
read_spss as read_spss,
114-
read_sql as read_sql,
115-
read_sql_query as read_sql_query,
116118
read_sql_table as read_sql_table,
117119
read_stata as read_stata,
118-
read_table as read_table,
119-
read_xml as read_xml,
120120
)
121-
from pandas.io.json._normalize import json_normalize as json_normalize
121+
from pandas.io.api import (
122+
read_clipboard as read_clipboard, # pyright: ignore[reportUnknownVariableType]
123+
)
124+
from pandas.io.api import (
125+
read_csv as read_csv, # pyright: ignore[reportUnknownVariableType]
126+
)
127+
from pandas.io.api import (
128+
read_excel as read_excel, # pyright: ignore[reportUnknownVariableType]
129+
)
130+
from pandas.io.api import (
131+
read_html as read_html, # pyright: ignore[reportUnknownVariableType]
132+
)
133+
from pandas.io.api import (
134+
read_orc as read_orc, # pyright: ignore[reportUnknownVariableType]
135+
)
136+
from pandas.io.api import (
137+
read_parquet as read_parquet, # pyright: ignore[reportUnknownVariableType]
138+
)
139+
from pandas.io.api import (
140+
read_sql as read_sql, # pyright: ignore[reportUnknownVariableType]
141+
)
142+
from pandas.io.api import (
143+
read_sql_query as read_sql_query, # pyright: ignore[reportUnknownVariableType]
144+
)
145+
from pandas.io.api import (
146+
read_table as read_table, # pyright: ignore[reportUnknownVariableType]
147+
)
148+
from pandas.io.api import (
149+
read_xml as read_xml, # pyright: ignore[reportUnknownVariableType]
150+
)
151+
from pandas.io.json._normalize import (
152+
json_normalize as json_normalize, # pyright: ignore[reportUnknownVariableType]
153+
)
122154
from pandas.tseries import offsets as offsets
123155
from pandas.tseries.api import infer_freq as infer_freq
124156

pandas-stubs/core/api.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ from pandas.core.indexing import IndexSlice as IndexSlice
5050
from pandas.core.series import Series as Series
5151
from pandas.core.tools.datetimes import to_datetime as to_datetime
5252
from pandas.core.tools.numeric import to_numeric as to_numeric
53-
from pandas.core.tools.timedeltas import to_timedelta as to_timedelta
53+
from pandas.core.tools.timedeltas import (
54+
to_timedelta as to_timedelta, # pyright: ignore[reportUnknownVariableType]
55+
)
5456

5557
from pandas._libs import (
5658
NaT as NaT,
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
from pandas.core.computation.eval import eval as eval
1+
from pandas.core.computation.eval import (
2+
eval as eval, # pyright: ignore[reportUnknownVariableType]
3+
)

pandas-stubs/core/frame.pyi

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ from pandas.core.indexing import (
5757
_LocIndexer,
5858
)
5959
from pandas.core.reshape.pivot import (
60-
_PivotAggFunc,
60+
_PivotAggFunc, # pyright: ignore[reportUnknownVariableType]
61+
)
62+
from pandas.core.reshape.pivot import (
6163
_PivotTableColumnsTypes,
6264
_PivotTableIndexTypes,
6365
_PivotTableValuesTypes,
@@ -81,12 +83,13 @@ from pandas._libs.lib import _NoDefaultDoNotUse
8183
from pandas._libs.missing import NAType
8284
from pandas._libs.tslibs import BaseOffset
8385
from pandas._libs.tslibs.nattype import NaTType
86+
from pandas._typing import (
87+
AggFuncTypeFrame, # pyright: ignore[reportUnknownVariableType]
88+
)
8489
from pandas._typing import (
8590
S2,
86-
AggFuncTypeBase,
8791
AggFuncTypeDictFrame,
8892
AggFuncTypeDictSeries,
89-
AggFuncTypeFrame,
9093
AlignJoin,
9194
AnyAll,
9295
AnyArrayLike,
@@ -171,6 +174,7 @@ from pandas._typing import (
171174
np_ndarray_float,
172175
np_ndarray_num,
173176
)
177+
from pandas._typing import AggFuncTypeBase # pyright: ignore[reportUnknownVariableType]
174178

175179
from pandas.io.formats.style import Styler
176180
from pandas.plotting import PlotAccessor
@@ -1527,7 +1531,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
15271531
axis: Axis = 0,
15281532
**kwargs: Any,
15291533
) -> Self: ...
1530-
agg = aggregate
1534+
agg = aggregate # pyright: ignore[reportUnknownVariableType]
15311535
def transform(
15321536
self,
15331537
func: AggFuncTypeFrame[..., Any],

pandas-stubs/core/groupby/generic.pyi

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ from pandas.core.series import Series
2929
from typing_extensions import Self
3030

3131
from pandas._libs.tslibs.timestamps import Timestamp
32+
from pandas._typing import (
33+
AggFuncTypeFrame, # pyright: ignore[reportUnknownVariableType]
34+
)
3235
from pandas._typing import (
3336
S2,
3437
S3,
35-
AggFuncTypeBase,
36-
AggFuncTypeFrame,
3738
ByT,
3839
CorrelationMethod,
3940
Dtype,
@@ -48,6 +49,7 @@ from pandas._typing import (
4849
WindowingEngineKwargs,
4950
np_ndarray,
5051
)
52+
from pandas._typing import AggFuncTypeBase # pyright: ignore[reportUnknownVariableType]
5153

5254
AggScalar: TypeAlias = str | Callable[..., Any]
5355

@@ -95,7 +97,7 @@ class SeriesGroupBy(GroupBy[Series[S2]], Generic[S2, ByT]):
9597
engine_kwargs: WindowingEngineKwargs = ...,
9698
**kwargs: Any,
9799
) -> Series: ...
98-
agg = aggregate
100+
agg = aggregate # pyright: ignore[reportUnknownVariableType]
99101
@overload
100102
def transform(
101103
self,
@@ -276,7 +278,7 @@ class DataFrameGroupBy(GroupBy[DataFrame], Generic[ByT, _TT]):
276278
/,
277279
**kwargs: Any,
278280
) -> DataFrame: ...
279-
agg = aggregate
281+
agg = aggregate # pyright: ignore[reportUnknownVariableType]
280282
@overload
281283
def transform(
282284
self,

pandas-stubs/core/reshape/api.pyi

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@ from pandas.core.reshape.merge import (
1414
merge_ordered as merge_ordered,
1515
)
1616
from pandas.core.reshape.pivot import (
17-
crosstab as crosstab,
17+
crosstab as crosstab, # pyright: ignore[reportUnknownVariableType]
18+
)
19+
from pandas.core.reshape.pivot import (
1820
pivot as pivot,
19-
pivot_table as pivot_table,
21+
)
22+
from pandas.core.reshape.pivot import (
23+
pivot_table as pivot_table, # pyright: ignore[reportUnknownVariableType]
24+
)
25+
from pandas.core.reshape.tile import (
26+
cut as cut, # pyright: ignore[reportUnknownVariableType]
2027
)
2128
from pandas.core.reshape.tile import (
22-
cut as cut,
2329
qcut as qcut,
2430
)

pandas-stubs/core/reshape/pivot.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ from pandas._typing import (
3434

3535
_PivotAggCallable: TypeAlias = Callable[[Series], ScalarT]
3636

37-
_PivotAggFunc: TypeAlias = (
37+
_PivotAggFunc: TypeAlias = ( # pyright: ignore[reportUnknownVariableType]
3838
_PivotAggCallable
3939
| np.ufunc
4040
| Literal["mean", "sum", "count", "min", "max", "median", "std", "var"]

pandas-stubs/core/series.pyi

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,15 @@ from pandas._libs.lib import _NoDefaultDoNotUse
136136
from pandas._libs.missing import NAType
137137
from pandas._libs.tslibs import BaseOffset
138138
from pandas._libs.tslibs.nattype import NaTType
139+
from pandas._typing import (
140+
AggFuncTypeSeriesToFrame, # pyright: ignore[reportUnknownVariableType]
141+
)
139142
from pandas._typing import (
140143
S1,
141144
S2,
142145
S2_NSDT,
143146
T_COMPLEX,
144-
AggFuncTypeBase,
145147
AggFuncTypeDictFrame,
146-
AggFuncTypeSeriesToFrame,
147148
AnyAll,
148149
AnyArrayLike,
149150
ArrayLike,
@@ -246,6 +247,7 @@ from pandas._typing import (
246247
np_ndarray_str,
247248
np_ndarray_td,
248249
)
250+
from pandas._typing import AggFuncTypeBase # pyright: ignore[reportUnknownVariableType]
249251

250252
from pandas.core.dtypes.base import ExtensionDtype
251253
from pandas.core.dtypes.dtypes import CategoricalDtype
@@ -1149,7 +1151,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
11491151
*args: Any,
11501152
**kwargs: Any,
11511153
) -> Series: ...
1152-
agg = aggregate
1154+
agg = aggregate # pyright: ignore[reportUnknownVariableType]
11531155
@overload
11541156
def transform( # pyright: ignore[reportOverlappingOverload]
11551157
self,

pandas-stubs/core/window/rolling.pyi

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ from typing_extensions import Self
1919

2020
from pandas._libs.tslibs import BaseOffset
2121
from pandas._typing import (
22-
AggFuncTypeBase,
23-
AggFuncTypeFrame,
24-
AggFuncTypeSeriesToFrame,
22+
AggFuncTypeFrame, # pyright: ignore[reportUnknownVariableType]
23+
)
24+
from pandas._typing import (
25+
AggFuncTypeSeriesToFrame, # pyright: ignore[reportUnknownVariableType]
26+
)
27+
from pandas._typing import (
2528
AxisInt,
2629
CalculationMethod,
2730
IntervalClosedType,
@@ -31,6 +34,7 @@ from pandas._typing import (
3134
WindowingEngineKwargs,
3235
WindowingRankType,
3336
)
37+
from pandas._typing import AggFuncTypeBase # pyright: ignore[reportUnknownVariableType]
3438

3539
class BaseWindow(SelectionMixin[NDFrameT]):
3640
on: str | Index | None
@@ -66,7 +70,7 @@ class BaseWindow(SelectionMixin[NDFrameT]):
6670
*args: Any,
6771
**kwargs: Any,
6872
) -> DataFrame: ...
69-
agg = aggregate
73+
agg = aggregate # pyright: ignore[reportUnknownVariableType]
7074

7175
class BaseWindowGroupby(BaseWindow[NDFrameT]): ...
7276

0 commit comments

Comments
 (0)