You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to iron out differences between several datetime-parsing paths. array_to_datetime and array_strptime (which to_datetime goes through when a format is specified) have different behavior for ints/floats. array_to_datetime will cast (non-nan) floats to str and then send those through the string parsing, so the int 20231024 gets treated like the string "20231024" as in the example above.
We have 77 tests that hit this path in array_strptime, 2 of them in test_sql, 25 of them in test_stata (though #55642 will get rid of those), the rest in test_to_datetime.
(Note also that array_to_datetime_with_unit has a now-deprecated behavior casting strings to floats!)
Some options
Change nothing, the status quo is fine
Tell users to explicitly cast their ints/floats to strings if thats what they want
Move away from allowing floats/ints in either array_to_datetime or array_strptime; all-numeric cases get their own path (DatetimeIndex does this with a check for infer_dtype(data) == "integer") and push users to do something explicit with mixed-type cases before getting to to_datetime
The text was updated successfully, but these errors were encountered:
I'm trying to iron out differences between several datetime-parsing paths. array_to_datetime and array_strptime (which to_datetime goes through when a
format
is specified) have different behavior for ints/floats. array_to_datetime will cast (non-nan) floats to str and then send those through the string parsing, so the int 20231024 gets treated like the string "20231024" as in the example above.We have 77 tests that hit this path in array_strptime, 2 of them in test_sql, 25 of them in test_stata (though #55642 will get rid of those), the rest in test_to_datetime.
(Note also that array_to_datetime_with_unit has a now-deprecated behavior casting strings to floats!)
Some options
The text was updated successfully, but these errors were encountered: