Skip to content

Commit b761b46

Browse files
committed
enable reportMissingTypeArgument
1 parent 5fa39f3 commit b761b46

File tree

14 files changed

+30
-33
lines changed

14 files changed

+30
-33
lines changed

pandas-stubs/_typing.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ ListLikeExceptSeriesAndStr: TypeAlias = (
980980
)
981981
ListLikeU: TypeAlias = Sequence[Any] | np_1darray | Series | Index
982982
ListLikeHashable: TypeAlias = (
983-
MutableSequence[HashableT] | np_1darray | tuple[HashableT, ...] | range
983+
MutableSequence[HashableT0] | np_1darray | tuple[HashableT0, ...] | range
984984
)
985985

986986
class SupportsDType(Protocol[GenericT_co]):
@@ -1114,7 +1114,7 @@ GroupByObjectNonScalar: TypeAlias = (
11141114
| Grouper
11151115
| list[Grouper]
11161116
)
1117-
GroupByObject: TypeAlias = Scalar | Index | GroupByObjectNonScalar | Series
1117+
GroupByObject: TypeAlias = Scalar | Index | GroupByObjectNonScalar[_HashableTa] | Series
11181118

11191119
StataDateFormat: TypeAlias = Literal[
11201120
"tc",

pandas-stubs/core/frame.pyi

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ from pandas.core.indexing import (
5858
_LocIndexer,
5959
)
6060
from pandas.core.reshape.pivot import (
61-
_PivotAggFunc,
61+
_PivotAggFuncTypes,
6262
_PivotTableColumnsTypes,
6363
_PivotTableIndexTypes,
6464
_PivotTableValuesTypes,
@@ -178,7 +178,7 @@ from pandas.plotting import PlotAccessor
178178
from pandas.plotting._core import _BoxPlotT
179179

180180
_T_MUTABLE_MAPPING_co = TypeVar(
181-
"_T_MUTABLE_MAPPING_co", bound=MutableMapping, covariant=True
181+
"_T_MUTABLE_MAPPING_co", bound=MutableMapping[Any, Any], covariant=True
182182
)
183183

184184
_iLocSetItemKey: TypeAlias = (
@@ -1378,9 +1378,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
13781378
values: _PivotTableValuesTypes = None,
13791379
index: _PivotTableIndexTypes = None,
13801380
columns: _PivotTableColumnsTypes = None,
1381-
aggfunc: (
1382-
_PivotAggFunc | Sequence[_PivotAggFunc] | Mapping[Hashable, _PivotAggFunc]
1383-
) = "mean",
1381+
aggfunc: _PivotAggFuncTypes[Scalar] = "mean",
13841382
fill_value: Scalar | None = None,
13851383
margins: _bool = False,
13861384
dropna: _bool = True,

pandas-stubs/core/indexes/accessors.pyi

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ from datetime import (
55
tzinfo as _tzinfo,
66
)
77
from typing import (
8+
Any,
89
Generic,
910
Literal,
1011
TypeVar,
@@ -377,7 +378,7 @@ class PeriodProperties(
377378
Series[Timestamp], Series[int], Series[str], DatetimeArray, PeriodArray
378379
],
379380
_DatetimeFieldOps[Series[int]],
380-
_IsLeapYearProperty,
381+
_IsLeapYearProperty[_DTBoolOpsReturnType],
381382
_FreqProperty[BaseOffset],
382383
): ...
383384
class CombinedDatetimelikeProperties(
@@ -393,7 +394,9 @@ class CombinedDatetimelikeProperties(
393394
Series[Period],
394395
],
395396
_TimedeltaPropertiesNoRounding[Series[int], Series[float]],
396-
_PeriodProperties,
397+
_PeriodProperties[
398+
Series[Timestamp], Series[int], Series[str], DatetimeArray, PeriodArray
399+
],
397400
): ...
398401

399402
@type_check_only
@@ -458,7 +461,7 @@ class DtDescriptor:
458461
@overload
459462
def __get__(
460463
self, instance: Series[Period], owner: type[Series]
461-
) -> PeriodProperties: ...
464+
) -> PeriodProperties[Any]: ...
462465

463466
@type_check_only
464467
class ArrayDescriptor:

pandas-stubs/core/indexes/period.pyi

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
from collections.abc import Hashable
22
import datetime
3-
from typing import (
4-
Any,
5-
overload,
6-
)
3+
from typing import overload
74

85
import numpy as np
96
import pandas as pd
@@ -30,7 +27,7 @@ from pandas._typing import (
3027
class PeriodIndex(DatetimeIndexOpsMixin[pd.Period, np.object_], PeriodIndexFieldOps):
3128
def __new__(
3229
cls,
33-
data: AxesData[Any] | None = None,
30+
data: AxesData | None = None,
3431
freq: Frequency | None = None,
3532
dtype: Dtype | None = None,
3633
copy: bool = False,

pandas-stubs/core/series.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
534534
Scalar
535535
| _DataLike
536536
| Mapping[HashableT1, Any]
537-
| BaseGroupBy
537+
| BaseGroupBy[Any]
538538
| NaTType
539539
| NAType
540540
| None
@@ -1105,7 +1105,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
11051105
def swaplevel(
11061106
self, i: Level = -2, j: Level = -1, copy: _bool = True
11071107
) -> Series[S1]: ...
1108-
def reorder_levels(self, order: list[Any]) -> Series[S1]: ...
1108+
def reorder_levels(self, order: Sequence[int | np.integer]) -> Series[S1]: ...
11091109
def explode(self, ignore_index: _bool = ...) -> Series[S1]: ...
11101110
def unstack(
11111111
self,

pandas-stubs/io/html.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ from pandas._typing import (
2929
def read_html(
3030
io: FilePath | ReadBuffer[str],
3131
*,
32-
match: str | Pattern = ...,
32+
match: str | Pattern[str] = ...,
3333
flavor: HTMLFlavors | Sequence[HTMLFlavors] | None = ...,
3434
header: int | Sequence[int] | None = ...,
3535
index_col: int | Sequence[int] | list[HashableT1] | None = ...,

pandas-stubs/io/sql.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ _SQLStatement: TypeAlias = (
3333
str
3434
| sqlalchemy.sql.expression.Selectable
3535
| sqlalchemy.sql.expression.TextClause
36-
| sqlalchemy.sql.Select
37-
| FromStatement
36+
| sqlalchemy.sql.Select[Any]
37+
| FromStatement[Any]
3838
| sqlalchemy.sql.expression.UpdateBase
3939
)
4040

pandas-stubs/io/xml.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from collections.abc import Sequence
2+
from typing import Any
23

34
from pandas.core.frame import DataFrame
45

@@ -25,7 +26,7 @@ def read_xml(
2526
names: Sequence[str] | None = ...,
2627
dtype: DtypeArg | None = ...,
2728
converters: ConvertersArg | None = ...,
28-
parse_dates: ParseDatesArg | None = ...,
29+
parse_dates: ParseDatesArg[Any, Any] | None = ...,
2930
# encoding can not be None for lxml and StringIO input
3031
encoding: str | None = ...,
3132
parser: XMLParsers = ...,

pandas-stubs/plotting/_core.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class _BoxPlotT(NamedTuple):
3939
_SingleColor: TypeAlias = (
4040
str | list[float] | tuple[float, float, float] | tuple[float, float, float, float]
4141
)
42-
_PlotAccessorColor: TypeAlias = str | list[_SingleColor] | dict[HashableT, _SingleColor]
42+
_PlotAccessorColor: TypeAlias = str | list[_SingleColor] | dict[Any, _SingleColor]
4343

4444
# Keep in sync with `DataFrame.boxplot`
4545
@overload

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ include = ["tests", "pandas-stubs"]
298298
enableTypeIgnoreComments = false # use pyright-specific ignores
299299
# disable subset of strict
300300
reportMissingParameterType = false
301-
reportMissingTypeArgument = false
302301
reportUnnecessaryTypeIgnoreComment = true
303302
reportUnknownArgumentType = false
304303
reportUnknownLambdaType = false

0 commit comments

Comments
 (0)