File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,9 @@ DatetimeScalar: TypeAlias = Scalar | datetime | np.datetime64 | date
38
38
39
39
DatetimeScalarOrArrayConvertible : TypeAlias = DatetimeScalar | ArrayConvertible
40
40
41
- DatetimeDictArg : TypeAlias = list [Scalar ] | tuple [Scalar , ...] | AnyArrayLike | int
41
+ DatetimeDictArg : TypeAlias = (
42
+ list [int | str ] | tuple [int | str , ...] | AnyArrayLike | int | str
43
+ )
42
44
43
45
class YearMonthDayDict (TypedDict , total = True ):
44
46
year : DatetimeDictArg
Original file line number Diff line number Diff line change @@ -1342,6 +1342,20 @@ def test_to_datetime_series() -> None:
1342
1342
{
1343
1343
"year" : ts .year ,
1344
1344
"month" : ts .month ,
1345
+ "day" : "1" ,
1346
+ }
1347
+ ),
1348
+ "TimestampSeries" ,
1349
+ ),
1350
+ pd .Series ,
1351
+ pd .Timestamp ,
1352
+ )
1353
+ check (
1354
+ assert_type (
1355
+ pd .to_datetime (
1356
+ {
1357
+ "year" : [2024 , "2023" ],
1358
+ "month" : 4 ,
1345
1359
"day" : 1 ,
1346
1360
}
1347
1361
),
You can’t perform that action at this time.
0 commit comments