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
3838
3939DatetimeScalarOrArrayConvertible : TypeAlias = DatetimeScalar | ArrayConvertible
4040
41- DatetimeDictArg : TypeAlias = list [Scalar ] | tuple [Scalar , ...] | AnyArrayLike | int
41+ DatetimeDictArg : TypeAlias = (
42+ list [int | str ] | tuple [int | str , ...] | AnyArrayLike | int | str
43+ )
4244
4345class YearMonthDayDict (TypedDict , total = True ):
4446 year : DatetimeDictArg
Original file line number Diff line number Diff line change @@ -1342,6 +1342,20 @@ def test_to_datetime_series() -> None:
13421342 {
13431343 "year" : ts .year ,
13441344 "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 ,
13451359 "day" : 1 ,
13461360 }
13471361 ),
You can’t perform that action at this time.
0 commit comments