API/PERF: when to check for mismatched tzs/awareness in array_to_datetime #55779
Labels
API Design
Constructors
Series/DataFrame/Index/pd.array Constructors
Datetime
Datetime data dtype
Performance
Memory or execution speed performance
If we pass mixed-tz datetime objects, we do a tz-match check at each step of the loop inside
array_to_datetime
/array_strptime
(specifically instate.process_datetime
). If we pass mixed-tz strings, the analogous check happens outside the loop. (per #55693 we currently dont have mixed-type checks)Eventually these checks should be shared, which means we need to decide on the in-loop or after-loop versions. Three differences for users are
The errors=coerce/ignore part is the API part of the issue (though xref #54467 for deprecating ignore). I think it is very likely that the original intent of coerce was to handle invalid individual items, not invalid combinations of items, so would be OK with the API change that would come with moving this outside the loop.
The text was updated successfully, but these errors were encountered: