I had a hack where I defaulted using get_supported_reso. But new pandas · pandas-dev/pandas@5bd2c2e (original) (raw)

Original file line number Diff line number Diff line change
@@ -486,7 +486,11 @@ def ensure_wrapped_if_datetimelike(arr):
486 486 if arr.dtype.kind == "M":
487 487 from pandas.core.arrays import DatetimeArray
488 488
489 -dtype = get_supported_dtype(arr.dtype)
489 +dtype = arr.dtype
490 +# get_supported_type is hacked to return [ms] instead of [s]
491 +# I dont want this to change.
492 +if not is_supported_dtype(dtype):
493 +dtype = get_supported_dtype(dtype)
490 494 return DatetimeArray._from_sequence(arr, dtype=dtype)
491 495
492 496 elif arr.dtype.kind == "m":