File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -289,6 +289,14 @@ class DataFrame(NDFrame, OpsMixin):
289
289
orient : Literal ["columns" , "tight" ] = ...,
290
290
dtype : AstypeArg | None = ...,
291
291
) -> DataFrame : ...
292
+ @overload
293
+ @classmethod
294
+ def from_dict (
295
+ cls ,
296
+ data : dict [Any , Any ],
297
+ orient : str ,
298
+ dtype : AstypeArg | None = ...,
299
+ ) -> DataFrame : ...
292
300
def to_numpy (
293
301
self ,
294
302
dtype : npt .DTypeLike | None = ...,
Original file line number Diff line number Diff line change @@ -1546,6 +1546,15 @@ def test_types_from_dict() -> None:
1546
1546
),
1547
1547
pd .DataFrame ,
1548
1548
)
1549
+ # check when not using Literal
1550
+ orient_str = "index"
1551
+ check (
1552
+ assert_type (
1553
+ pd .DataFrame .from_dict (data , orient = orient_str ),
1554
+ pd .DataFrame ,
1555
+ ),
1556
+ pd .DataFrame ,
1557
+ )
1549
1558
1550
1559
1551
1560
def test_pipe () -> None :
You can’t perform that action at this time.
0 commit comments