API/BUG: partially-inferring datetimes #40111
Labels
API - Consistency
Internal Consistency of API/Behavior
Bug
Constructors
Series/DataFrame/Index/pd.array Constructors
Dtype Conversions
Unexpected or buggy dtype conversions
from
test_mixed_offsets_with_native_datetime_raises
As expected, this comes back as object-dtype, but it also does some casting:
ser[0]
is a str "NaT" andser[[2, 3]]
are stdlib datetime objects. ser[1] and ser[4] are unchanged.This casting is done inside a call to
to_datetime
, but has the surprising effect of not being idempotent:I'd expect
ser
to be constructed without doing any casting.The text was updated successfully, but these errors were encountered: