Skip to content

Commit 3cd3d9e

Browse files
committed
dict
1 parent 7c90b93 commit 3cd3d9e

File tree

7 files changed

+43
-30
lines changed

7 files changed

+43
-30
lines changed

pandas-stubs/core/frame.pyi

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
502502
self,
503503
orient: Literal["index"],
504504
*,
505-
into: defaultdict,
505+
into: defaultdict[Hashable, Any],
506506
index: Literal[True] = True,
507507
) -> defaultdict[Hashable, dict[Hashable, Any]]: ...
508508
@overload
@@ -1022,7 +1022,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
10221022
@overload
10231023
def fillna(
10241024
self,
1025-
value: Scalar | NAType | dict | Series | DataFrame | None = ...,
1025+
value: Scalar | NAType | dict[Hashable, Any] | Series | DataFrame | None = ...,
10261026
*,
10271027
axis: Axis | None = ...,
10281028
limit: int = ...,
@@ -1032,7 +1032,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
10321032
@overload
10331033
def fillna(
10341034
self,
1035-
value: Scalar | NAType | dict | Series | DataFrame | None = ...,
1035+
value: Scalar | NAType | dict[Hashable, Any] | Series | DataFrame | None = ...,
10361036
*,
10371037
axis: Axis | None = ...,
10381038
limit: int = ...,
@@ -1715,7 +1715,10 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
17151715
validate: MergeValidate | None = None,
17161716
) -> Self: ...
17171717
def round(
1718-
self, decimals: int | dict | Series = ..., *args: Any, **kwargs: Any
1718+
self,
1719+
decimals: int | dict[Hashable, Any] | Series = ...,
1720+
*args: Any,
1721+
**kwargs: Any,
17191722
) -> Self: ...
17201723
def corr(
17211724
self,
@@ -2665,7 +2668,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
26652668
compression: CompressionOptions = ...,
26662669
index: _bool | None = ...,
26672670
indent: int | None = ...,
2668-
storage_options: dict | None = ...,
2671+
storage_options: dict[Hashable, Any] | None = ...,
26692672
mode: Literal["a"],
26702673
) -> None: ...
26712674
@overload
@@ -2683,7 +2686,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
26832686
compression: CompressionOptions = ...,
26842687
index: _bool | None = ...,
26852688
indent: int | None = ...,
2686-
storage_options: dict | None = ...,
2689+
storage_options: dict[Hashable, Any] | None = ...,
26872690
mode: Literal["a"],
26882691
) -> _str: ...
26892692
@overload
@@ -2701,7 +2704,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
27012704
compression: CompressionOptions = ...,
27022705
index: _bool | None = ...,
27032706
indent: int | None = ...,
2704-
storage_options: dict | None = ...,
2707+
storage_options: dict[Hashable, Any] | None = ...,
27052708
mode: Literal["w"] = ...,
27062709
) -> _str: ...
27072710
@overload
@@ -2719,7 +2722,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
27192722
compression: CompressionOptions = ...,
27202723
index: _bool | None = ...,
27212724
indent: int | None = ...,
2722-
storage_options: dict | None = ...,
2725+
storage_options: dict[Hashable, Any] | None = ...,
27232726
mode: Literal["w"] = ...,
27242727
) -> None: ...
27252728
@overload

pandas-stubs/core/groupby/generic.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ _TT = TypeVar("_TT", bound=Literal[True, False])
219219
class DFCallable1(Protocol[P]): # ty: ignore[invalid-argument-type]
220220
def __call__(
221221
self, df: DataFrame, /, *args: P.args, **kwargs: P.kwargs
222-
) -> Scalar | list[Any] | dict: ...
222+
) -> Scalar | list[Any] | dict[Hashable, Any]: ...
223223

224224
class DFCallable2(Protocol[P]): # ty: ignore[invalid-argument-type]
225225
def __call__(

pandas-stubs/core/series.pyi

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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 | None = None,
1107+
fill_value: int | _str | dict[Hashable, Any] | None = None,
11081108
sort: _bool = True,
11091109
) -> DataFrame: ...
11101110
@overload
@@ -1258,7 +1258,9 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
12581258
@overload
12591259
def fillna(
12601260
self,
1261-
value: Scalar | NAType | dict | Series[S1] | DataFrame | None = ...,
1261+
value: (
1262+
Scalar | NAType | dict[Hashable, Any] | Series[S1] | DataFrame | None
1263+
) = ...,
12621264
*,
12631265
axis: AxisIndex = ...,
12641266
limit: int | None = ...,
@@ -1267,7 +1269,9 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
12671269
@overload
12681270
def fillna(
12691271
self,
1270-
value: Scalar | NAType | dict | Series[S1] | DataFrame | None = ...,
1272+
value: (
1273+
Scalar | NAType | dict[Hashable, Any] | Series[S1] | DataFrame | None
1274+
) = ...,
12711275
*,
12721276
axis: AxisIndex = ...,
12731277
limit: int | None = ...,
@@ -4637,7 +4641,9 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
46374641
def rename_axis(
46384642
self,
46394643
*,
4640-
index: Scalar | ListLike | Callable[..., Any] | dict | None = ...,
4644+
index: (
4645+
Scalar | ListLike | Callable[..., Any] | dict[Hashable, Any] | None
4646+
) = ...,
46414647
copy: _bool = ...,
46424648
inplace: Literal[True],
46434649
) -> None: ...
@@ -4646,7 +4652,9 @@ class Series(IndexOpsMixin[S1], ElementOpsMixin[S1], NDFrame):
46464652
def rename_axis(
46474653
self,
46484654
*,
4649-
index: Scalar | ListLike | Callable[..., Any] | dict | None = ...,
4655+
index: (
4656+
Scalar | ListLike | Callable[..., Any] | dict[Hashable, Any] | None
4657+
) = ...,
46504658
copy: _bool = ...,
46514659
inplace: Literal[False] = False,
46524660
) -> Self: ...

pandas-stubs/io/clipboards.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def read_clipboard(
3636
names: ListLikeHashable | None = ...,
3737
index_col: int | str | Sequence[str | int] | Literal[False] | None = ...,
3838
usecols: UsecolsArgType = ...,
39-
dtype: DtypeArg | defaultdict | None = ...,
39+
dtype: DtypeArg | defaultdict[Hashable, Any] | None = ...,
4040
engine: CSVEngine | None = ...,
4141
converters: dict[int | str, Callable[[str], Any]] = ...,
4242
true_values: list[str] = ...,
@@ -95,7 +95,7 @@ def read_clipboard(
9595
names: ListLikeHashable | None = ...,
9696
index_col: int | str | Sequence[str | int] | Literal[False] | None = ...,
9797
usecols: UsecolsArgType = ...,
98-
dtype: DtypeArg | defaultdict | None = ...,
98+
dtype: DtypeArg | defaultdict[Hashable, Any] | None = ...,
9999
engine: CSVEngine | None = ...,
100100
converters: dict[int | str, Callable[[str], Any]] = ...,
101101
true_values: list[str] = ...,
@@ -154,7 +154,7 @@ def read_clipboard(
154154
names: ListLikeHashable | None = ...,
155155
index_col: int | str | Sequence[str | int] | Literal[False] | None = ...,
156156
usecols: UsecolsArgType = ...,
157-
dtype: DtypeArg | defaultdict | None = ...,
157+
dtype: DtypeArg | defaultdict[Hashable, Any] | None = ...,
158158
engine: CSVEngine | None = ...,
159159
converters: dict[int | str, Callable[[str], Any]] = ...,
160160
true_values: list[str] = ...,

pandas-stubs/io/json/_normalize.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
from typing import Any
2+
13
from pandas import DataFrame
24

35
from pandas._typing import IgnoreRaise
46

57
def json_normalize(
6-
data: dict | list[dict],
8+
data: dict[str, Any] | list[dict[str, Any]],
79
record_path: str | list[str] | None = None,
810
meta: str | list[str | list[str]] | None = None,
911
meta_prefix: str | None = None,

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 | None = None,
47+
dtype: DtypeArg | defaultdict[Hashable, 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 | None = None,
110+
dtype: DtypeArg | defaultdict[Hashable, 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 | None = ...,
173+
dtype: DtypeArg | defaultdict[Hashable, 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 | None = None,
236+
dtype: DtypeArg | defaultdict[Hashable, 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 | None = None,
299+
dtype: DtypeArg | defaultdict[Hashable, 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 | None = None,
362+
dtype: DtypeArg | defaultdict[Hashable, 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 | str = ...,
175-
xerr: DataFrame | Series | ArrayLike | dict | str = ...,
174+
yerr: DataFrame | Series | ArrayLike | dict[Hashable, Any] | str = ...,
175+
xerr: DataFrame | Series | ArrayLike | dict[Hashable, 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 | str = ...,
229-
xerr: DataFrame | Series | ArrayLike | dict | str = ...,
228+
yerr: DataFrame | Series | ArrayLike | dict[Hashable, Any] | str = ...,
229+
xerr: DataFrame | Series | ArrayLike | dict[Hashable, 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 | str = ...,
272-
xerr: DataFrame | Series | ArrayLike | dict | str = ...,
271+
yerr: DataFrame | Series | ArrayLike | dict[Hashable, Any] | str = ...,
272+
xerr: DataFrame | Series | ArrayLike | dict[Hashable, Any] | str = ...,
273273
stacked: bool = ...,
274274
secondary_y: bool | list[HashableT3] | tuple[HashableT3, ...] = ...,
275275
mark_right: bool = ...,

0 commit comments

Comments
 (0)