Skip to content

Commit bcefa8a

Browse files
committed
relax input
1 parent 435cf0e commit bcefa8a

File tree

7 files changed

+37
-47
lines changed

7 files changed

+37
-47
lines changed

pandas-stubs/core/computation/eval.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from collections.abc import (
2-
Hashable,
32
Mapping,
43
MutableSequence,
54
)
@@ -25,7 +24,7 @@ def eval(
2524
engine: Literal["python", "numexpr"] | None = ...,
2625
local_dict: dict[str, Any] | None = None,
2726
global_dict: dict[str, Any] | None = None,
28-
resolvers: MutableSequence[Mapping[Hashable, Any]] | None = ...,
27+
resolvers: MutableSequence[Mapping[Any, Any]] | None = ...,
2928
level: int = 0,
3029
target: object | None = None,
3130
inplace: bool = False,

pandas-stubs/core/frame.pyi

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
503503
self,
504504
orient: Literal["index"],
505505
*,
506-
into: defaultdict[Hashable, Any],
506+
into: defaultdict[Any, Any],
507507
index: Literal[True] = True,
508508
) -> defaultdict[Hashable, dict[Hashable, Any]]: ...
509509
@overload
@@ -551,7 +551,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
551551
self,
552552
orient: Literal["split", "tight"],
553553
*,
554-
into: MutableMapping[Hashable, Any] | type[MutableMapping],
554+
into: MutableMapping[Any, Any] | type[MutableMapping],
555555
index: bool = ...,
556556
) -> MutableMapping[str, list[Any]]: ...
557557
@overload
@@ -908,7 +908,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
908908
engine: Literal["python", "numexpr"] | None = ...,
909909
local_dict: dict[_str, Any] | None = ...,
910910
global_dict: dict[_str, Any] | None = ...,
911-
resolvers: MutableSequence[Mapping[Hashable, Any]] | None = ...,
911+
resolvers: MutableSequence[Mapping[Any, Any]] | None = ...,
912912
level: int = ...,
913913
target: object | None = ...,
914914
inplace: Literal[True],
@@ -923,7 +923,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
923923
engine: Literal["python", "numexpr"] | None = ...,
924924
local_dict: dict[_str, Any] | None = ...,
925925
global_dict: dict[_str, Any] | None = ...,
926-
resolvers: MutableSequence[Mapping[Hashable, Any]] | None = ...,
926+
resolvers: MutableSequence[Mapping[Any, Any]] | None = ...,
927927
level: int = ...,
928928
target: object | None = ...,
929929
) -> Self: ...
@@ -1023,7 +1023,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
10231023
@overload
10241024
def fillna(
10251025
self,
1026-
value: Scalar | NAType | dict[Hashable, Any] | Series | DataFrame | None = ...,
1026+
value: Scalar | NAType | dict[Any, Any] | Series | DataFrame | None = ...,
10271027
*,
10281028
axis: Axis | None = ...,
10291029
limit: int = ...,
@@ -1033,7 +1033,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
10331033
@overload
10341034
def fillna(
10351035
self,
1036-
value: Scalar | NAType | dict[Hashable, Any] | Series | DataFrame | None = ...,
1036+
value: Scalar | NAType | dict[Any, Any] | Series | DataFrame | None = ...,
10371037
*,
10381038
axis: Axis | None = ...,
10391039
limit: int = ...,
@@ -1717,7 +1717,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
17171717
) -> Self: ...
17181718
def round(
17191719
self,
1720-
decimals: int | dict[Hashable, Any] | Series = ...,
1720+
decimals: int | dict[Any, Any] | Series = ...,
17211721
*args: Any,
17221722
**kwargs: Any,
17231723
) -> Self: ...
@@ -2669,7 +2669,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
26692669
compression: CompressionOptions = ...,
26702670
index: _bool | None = ...,
26712671
indent: int | None = ...,
2672-
storage_options: dict[Hashable, Any] | None = ...,
2672+
storage_options: dict[Any, Any] | None = ...,
26732673
mode: Literal["a"],
26742674
) -> None: ...
26752675
@overload
@@ -2687,7 +2687,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
26872687
compression: CompressionOptions = ...,
26882688
index: _bool | None = ...,
26892689
indent: int | None = ...,
2690-
storage_options: dict[Hashable, Any] | None = ...,
2690+
storage_options: dict[Any, Any] | None = ...,
26912691
mode: Literal["a"],
26922692
) -> _str: ...
26932693
@overload
@@ -2705,7 +2705,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
27052705
compression: CompressionOptions = ...,
27062706
index: _bool | None = ...,
27072707
indent: int | None = ...,
2708-
storage_options: dict[Hashable, Any] | None = ...,
2708+
storage_options: dict[Any, Any] | None = ...,
27092709
mode: Literal["w"] = ...,
27102710
) -> _str: ...
27112711
@overload
@@ -2723,7 +2723,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
27232723
compression: CompressionOptions = ...,
27242724
index: _bool | None = ...,
27252725
indent: int | None = ...,
2726-
storage_options: dict[Hashable, Any] | None = ...,
2726+
storage_options: dict[Any, Any] | None = ...,
27272727
mode: Literal["w"] = ...,
27282728
) -> None: ...
27292729
@overload

pandas-stubs/core/reshape/pivot.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def pivot_table(
7777
aggfunc: (
7878
_PivotAggFunc[Scalar]
7979
| Sequence[_PivotAggFunc[Scalar]]
80-
| Mapping[Hashable, _PivotAggFunc[Scalar]]
80+
| Mapping[Any, _PivotAggFunc[Scalar]]
8181
) = "mean",
8282
fill_value: Scalar | None = None,
8383
margins: bool = False,
@@ -104,7 +104,7 @@ def pivot_table(
104104
aggfunc: (
105105
_PivotAggFunc[Scalar]
106106
| Sequence[_PivotAggFunc[Scalar]]
107-
| Mapping[Hashable, _PivotAggFunc[Scalar]]
107+
| Mapping[Any, _PivotAggFunc[Scalar]]
108108
) = "mean",
109109
fill_value: Scalar | None = None,
110110
margins: bool = False,
@@ -129,7 +129,7 @@ def pivot_table(
129129
aggfunc: (
130130
_PivotAggFunc[Scalar]
131131
| Sequence[_PivotAggFunc[Scalar]]
132-
| Mapping[Hashable, _PivotAggFunc[Scalar]]
132+
| Mapping[Any, _PivotAggFunc[Scalar]]
133133
) = "mean",
134134
fill_value: Scalar | None = None,
135135
margins: bool = False,

pandas-stubs/core/series.pyi

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
776776
def to_dict(self, *, into: type[dict] = ...) -> dict[Any, S1]: ...
777777
@overload
778778
def to_dict(
779-
self, *, into: type[MutableMapping] | MutableMapping[Hashable, Any]
779+
self, *, into: type[MutableMapping] | MutableMapping[Any, Any]
780780
) -> MutableMapping[Hashable, S1]: ...
781781
def to_frame(self, name: object | None = ...) -> DataFrame: ...
782782
@overload
@@ -1104,7 +1104,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
11041104
def unstack(
11051105
self,
11061106
level: IndexLabel = -1,
1107-
fill_value: int | _str | dict[Hashable, Any] | None = None,
1107+
fill_value: int | _str | dict[Any, Any] | None = None,
11081108
sort: _bool = True,
11091109
) -> DataFrame: ...
11101110
@overload
@@ -1174,7 +1174,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
11741174
Scalar
11751175
| Sequence[Any]
11761176
| AbstractSet[Any]
1177-
| Mapping[Hashable, Any]
1177+
| Mapping[Any, Any]
11781178
| NAType
11791179
| None,
11801180
],
@@ -1264,9 +1264,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
12641264
@overload
12651265
def fillna(
12661266
self,
1267-
value: (
1268-
Scalar | NAType | dict[Hashable, Any] | Series[S1] | DataFrame | None
1269-
) = ...,
1267+
value: Scalar | NAType | dict[Any, Any] | Series[S1] | DataFrame | None = ...,
12701268
*,
12711269
axis: AxisIndex = ...,
12721270
limit: int | None = ...,
@@ -1275,9 +1273,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
12751273
@overload
12761274
def fillna(
12771275
self,
1278-
value: (
1279-
Scalar | NAType | dict[Hashable, Any] | Series[S1] | DataFrame | None
1280-
) = ...,
1276+
value: Scalar | NAType | dict[Any, Any] | Series[S1] | DataFrame | None = ...,
12811277
*,
12821278
axis: AxisIndex = ...,
12831279
limit: int | None = ...,
@@ -4647,9 +4643,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
46474643
def rename_axis(
46484644
self,
46494645
*,
4650-
index: (
4651-
Scalar | ListLike | Callable[..., Any] | dict[Hashable, Any] | None
4652-
) = ...,
4646+
index: Scalar | ListLike | Callable[..., Any] | dict[Any, Any] | None = ...,
46534647
copy: _bool = ...,
46544648
inplace: Literal[True],
46554649
) -> None: ...
@@ -4658,9 +4652,7 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
46584652
def rename_axis(
46594653
self,
46604654
*,
4661-
index: (
4662-
Scalar | ListLike | Callable[..., Any] | dict[Hashable, Any] | None
4663-
) = ...,
4655+
index: Scalar | ListLike | Callable[..., Any] | dict[Any, Any] | None = ...,
46644656
copy: _bool = ...,
46654657
inplace: Literal[False] = False,
46664658
) -> Self: ...

pandas-stubs/io/clipboards.pyi

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from collections import defaultdict
22
from collections.abc import (
33
Callable,
4-
Hashable,
54
Sequence,
65
)
76
import csv
@@ -37,7 +36,7 @@ def read_clipboard(
3736
names: ListLikeHashable | None = ...,
3837
index_col: int | str | Sequence[str | int] | Literal[False] | None = ...,
3938
usecols: UsecolsArgType = ...,
40-
dtype: DtypeArg | defaultdict[Hashable, Any] | None = ...,
39+
dtype: DtypeArg | defaultdict[Any, Any] | None = ...,
4140
engine: CSVEngine | None = ...,
4241
converters: dict[int | str, Callable[[str], Any]] = ...,
4342
true_values: list[str] = ...,
@@ -96,7 +95,7 @@ def read_clipboard(
9695
names: ListLikeHashable | None = ...,
9796
index_col: int | str | Sequence[str | int] | Literal[False] | None = ...,
9897
usecols: UsecolsArgType = ...,
99-
dtype: DtypeArg | defaultdict[Hashable, Any] | None = ...,
98+
dtype: DtypeArg | defaultdict[Any, Any] | None = ...,
10099
engine: CSVEngine | None = ...,
101100
converters: dict[int | str, Callable[[str], Any]] = ...,
102101
true_values: list[str] = ...,
@@ -155,7 +154,7 @@ def read_clipboard(
155154
names: ListLikeHashable | None = ...,
156155
index_col: int | str | Sequence[str | int] | Literal[False] | None = ...,
157156
usecols: UsecolsArgType = ...,
158-
dtype: DtypeArg | defaultdict[Hashable, Any] | None = ...,
157+
dtype: DtypeArg | defaultdict[Any, Any] | None = ...,
159158
engine: CSVEngine | None = ...,
160159
converters: dict[int | str, Callable[[str], Any]] = ...,
161160
true_values: list[str] = ...,

pandas-stubs/io/parsers/readers.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def read_csv(
4444
names: ListLikeHashable | None = ...,
4545
index_col: int | str | Sequence[str | int] | Literal[False] | None = None,
4646
usecols: UsecolsArgType[HashableT] = None,
47-
dtype: DtypeArg | defaultdict[Hashable, Any] | None = None,
47+
dtype: DtypeArg | defaultdict[Any, Any] | None = None,
4848
engine: CSVEngine | None = None,
4949
converters: (
5050
Mapping[int | str, Callable[[str], Any]]
@@ -107,7 +107,7 @@ def read_csv(
107107
names: ListLikeHashable | None = ...,
108108
index_col: int | str | Sequence[str | int] | Literal[False] | None = None,
109109
usecols: UsecolsArgType[HashableT] = None,
110-
dtype: DtypeArg | defaultdict[Hashable, Any] | None = None,
110+
dtype: DtypeArg | defaultdict[Any, Any] | None = None,
111111
engine: CSVEngine | None = None,
112112
converters: (
113113
Mapping[int | str, Callable[[str], Any]]
@@ -170,7 +170,7 @@ def read_csv(
170170
names: ListLikeHashable | None = ...,
171171
index_col: int | str | Sequence[str | int] | Literal[False] | None = ...,
172172
usecols: UsecolsArgType[HashableT] = ...,
173-
dtype: DtypeArg | defaultdict[Hashable, Any] | None = ...,
173+
dtype: DtypeArg | defaultdict[Any, Any] | None = ...,
174174
engine: CSVEngine | None = ...,
175175
converters: (
176176
Mapping[int | str, Callable[[str], Any]]
@@ -233,7 +233,7 @@ def read_table(
233233
names: ListLikeHashable | None = ...,
234234
index_col: int | str | Sequence[str | int] | Literal[False] | None = None,
235235
usecols: UsecolsArgType[HashableT] = None,
236-
dtype: DtypeArg | defaultdict[Hashable, Any] | None = None,
236+
dtype: DtypeArg | defaultdict[Any, Any] | None = None,
237237
engine: CSVEngine | None = None,
238238
converters: (
239239
Mapping[int | str, Callable[[str], Any]]
@@ -296,7 +296,7 @@ def read_table(
296296
names: ListLikeHashable | None = ...,
297297
index_col: int | str | Sequence[str | int] | Literal[False] | None = None,
298298
usecols: UsecolsArgType[HashableT] = None,
299-
dtype: DtypeArg | defaultdict[Hashable, Any] | None = None,
299+
dtype: DtypeArg | defaultdict[Any, Any] | None = None,
300300
engine: CSVEngine | None = None,
301301
converters: (
302302
Mapping[int | str, Callable[[str], Any]]
@@ -359,7 +359,7 @@ def read_table(
359359
names: ListLikeHashable | None = ...,
360360
index_col: int | str | Sequence[str | int] | Literal[False] | None = None,
361361
usecols: UsecolsArgType[HashableT] = None,
362-
dtype: DtypeArg | defaultdict[Hashable, Any] | None = None,
362+
dtype: DtypeArg | defaultdict[Any, Any] | None = None,
363363
engine: CSVEngine | None = None,
364364
converters: (
365365
Mapping[int | str, Callable[[str], Any]]

pandas-stubs/plotting/_core.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ class PlotAccessor:
171171
colorbar: bool = ...,
172172
position: float = ...,
173173
table: bool | Series | DataFrame = ...,
174-
yerr: DataFrame | Series | ArrayLike | dict[Hashable, Any] | str = ...,
175-
xerr: DataFrame | Series | ArrayLike | dict[Hashable, Any] | str = ...,
174+
yerr: DataFrame | Series | ArrayLike | dict[Any, Any] | str = ...,
175+
xerr: DataFrame | Series | ArrayLike | dict[Any, Any] | str = ...,
176176
stacked: bool = ...,
177177
secondary_y: bool | list[HashableT2] | tuple[HashableT2, ...] = ...,
178178
mark_right: bool = ...,
@@ -225,8 +225,8 @@ class PlotAccessor:
225225
colorbar: bool = ...,
226226
position: float = ...,
227227
table: bool | Series | DataFrame = ...,
228-
yerr: DataFrame | Series | ArrayLike | dict[Hashable, Any] | str = ...,
229-
xerr: DataFrame | Series | ArrayLike | dict[Hashable, Any] | str = ...,
228+
yerr: DataFrame | Series | ArrayLike | dict[Any, Any] | str = ...,
229+
xerr: DataFrame | Series | ArrayLike | dict[Any, Any] | str = ...,
230230
stacked: bool = ...,
231231
secondary_y: bool | list[HashableT3] | tuple[HashableT3, ...] = ...,
232232
mark_right: bool = ...,
@@ -268,8 +268,8 @@ class PlotAccessor:
268268
colorbar: bool = ...,
269269
position: float = ...,
270270
table: bool | Series | DataFrame = ...,
271-
yerr: DataFrame | Series | ArrayLike | dict[Hashable, Any] | str = ...,
272-
xerr: DataFrame | Series | ArrayLike | dict[Hashable, Any] | str = ...,
271+
yerr: DataFrame | Series | ArrayLike | dict[Any, Any] | str = ...,
272+
xerr: DataFrame | Series | ArrayLike | dict[Any, Any] | str = ...,
273273
stacked: bool = ...,
274274
secondary_y: bool | list[HashableT3] | tuple[HashableT3, ...] = ...,
275275
mark_right: bool = ...,

0 commit comments

Comments
 (0)