BUG/API: Timestamp(naive_str, tz=tz) vs Timestamp(naive_str).tz_localize(tz) #55657
Labels
Bug
Needs Triage
Issue that has not been reviewed by a pandas team member
Timestamp
pd.Timestamp and associated methods
I expected these to be equivalent. Am I wrong to expect that?
Looks like the constructor version goes through _localize_pydatetime (then pytz's tz.localize) instead of Timestamp.tz_localize which apparently doesn't find this case ambiguous.
Update: passing
is_dst=None
totz.localize
in _localize_pydatetime causes the constructor version to raise like I expected.Update 2: passing is_dst=None as above breaks two tests in the test suite: test_dti_tz_localize_ambiguous_infer and test_fallback_singular
The text was updated successfully, but these errors were encountered: