Skip to content

Commit 97e44e9

Browse files
committed
enable reportUnknownVariableType
1 parent ffa2396 commit 97e44e9

Some content is hidden

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

72 files changed

+842
-720
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
@@ -58,7 +58,9 @@ from pandas.core.indexing import (
5858
_LocIndexer,
5959
)
6060
from pandas.core.reshape.pivot import (
61-
_PivotAggFunc,
61+
_PivotAggFunc, # pyright: ignore[reportUnknownVariableType]
62+
)
63+
from pandas.core.reshape.pivot import (
6264
_PivotTableColumnsTypes,
6365
_PivotTableIndexTypes,
6466
_PivotTableValuesTypes,
@@ -82,12 +84,13 @@ from pandas._libs.lib import _NoDefaultDoNotUse
8284
from pandas._libs.missing import NAType
8385
from pandas._libs.tslibs import BaseOffset
8486
from pandas._libs.tslibs.nattype import NaTType
87+
from pandas._typing import (
88+
AggFuncTypeFrame, # pyright: ignore[reportUnknownVariableType]
89+
)
8590
from pandas._typing import (
8691
S2,
87-
AggFuncTypeBase,
8892
AggFuncTypeDictFrame,
8993
AggFuncTypeDictSeries,
90-
AggFuncTypeFrame,
9194
AlignJoin,
9295
AnyAll,
9396
AnyArrayLike,
@@ -172,6 +175,7 @@ from pandas._typing import (
172175
np_ndarray_float,
173176
np_ndarray_num,
174177
)
178+
from pandas._typing import AggFuncTypeBase # pyright: ignore[reportUnknownVariableType]
175179

176180
from pandas.io.formats.style import Styler
177181
from pandas.plotting import PlotAccessor
@@ -1538,7 +1542,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
15381542
axis: Axis = 0,
15391543
**kwargs: Any,
15401544
) -> Self: ...
1541-
agg = aggregate
1545+
agg = aggregate # pyright: ignore[reportUnknownVariableType]
15421546
def transform(
15431547
self,
15441548
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/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

pandas-stubs/io/api.pyi

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
1-
from pandas.io.clipboards import read_clipboard as read_clipboard
1+
from pandas.io.clipboards import (
2+
read_clipboard as read_clipboard, # pyright: ignore[reportUnknownVariableType]
3+
)
24
from pandas.io.excel import (
35
ExcelFile as ExcelFile,
46
ExcelWriter as ExcelWriter,
5-
read_excel as read_excel,
7+
)
8+
from pandas.io.excel import (
9+
read_excel as read_excel, # pyright: ignore[reportUnknownVariableType]
610
)
711
from pandas.io.feather_format import read_feather as read_feather
8-
from pandas.io.html import read_html as read_html
12+
from pandas.io.html import (
13+
read_html as read_html, # pyright: ignore[reportUnknownVariableType]
14+
)
915
from pandas.io.json import read_json as read_json
10-
from pandas.io.orc import read_orc as read_orc
11-
from pandas.io.parquet import read_parquet as read_parquet
16+
from pandas.io.orc import (
17+
read_orc as read_orc, # pyright: ignore[reportUnknownVariableType]
18+
)
19+
from pandas.io.parquet import (
20+
read_parquet as read_parquet, # pyright: ignore[reportUnknownVariableType]
21+
)
22+
from pandas.io.parsers import (
23+
read_csv as read_csv, # pyright: ignore[reportUnknownVariableType]
24+
)
1225
from pandas.io.parsers import (
13-
read_csv as read_csv,
1426
read_fwf as read_fwf,
15-
read_table as read_table,
27+
)
28+
from pandas.io.parsers import (
29+
read_table as read_table, # pyright: ignore[reportUnknownVariableType]
1630
)
1731
from pandas.io.pickle import (
1832
read_pickle as read_pickle,
@@ -24,9 +38,15 @@ from pandas.io.pytables import (
2438
from pandas.io.sas import read_sas as read_sas
2539
from pandas.io.spss import read_spss as read_spss
2640
from pandas.io.sql import (
27-
read_sql as read_sql,
28-
read_sql_query as read_sql_query,
41+
read_sql as read_sql, # pyright: ignore[reportUnknownVariableType]
42+
)
43+
from pandas.io.sql import (
44+
read_sql_query as read_sql_query, # pyright: ignore[reportUnknownVariableType]
45+
)
46+
from pandas.io.sql import (
2947
read_sql_table as read_sql_table,
3048
)
3149
from pandas.io.stata import read_stata as read_stata
32-
from pandas.io.xml import read_xml as read_xml
50+
from pandas.io.xml import (
51+
read_xml as read_xml, # pyright: ignore[reportUnknownVariableType]
52+
)

0 commit comments

Comments
 (0)