From fcc182bcab25ecbaefdecbd0eca8dc73579cd39f Mon Sep 17 00:00:00 2001 From: MarcoGorelli <> Date: Wed, 2 Nov 2022 14:01:24 +0000 Subject: [PATCH 1/2] maybe fix arm test --- pandas/core/arrays/datetimes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/arrays/datetimes.py b/pandas/core/arrays/datetimes.py index d2c2811759e7c..1ec3814c88f8d 100644 --- a/pandas/core/arrays/datetimes.py +++ b/pandas/core/arrays/datetimes.py @@ -2232,7 +2232,7 @@ def maybe_convert_dtype(data, copy: bool, tz: tzinfo | None = None): if is_float_dtype(data.dtype): # pre-2.0 we treated these as wall-times, inconsistent with ints # GH#23675, GH#45573 deprecated to treat symmetrically with integer dtypes - data = data.astype(np.int64) + data = data.astype("M8[ns]").view("i8") copy = False elif is_timedelta64_dtype(data.dtype) or is_bool_dtype(data.dtype): From 95aeb5242e36fc67f3a5dfed28d91819ce6883b8 Mon Sep 17 00:00:00 2001 From: MarcoGorelli <> Date: Wed, 2 Nov 2022 15:09:31 +0000 Subject: [PATCH 2/2] add comment linking to issue --- pandas/core/arrays/datetimes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandas/core/arrays/datetimes.py b/pandas/core/arrays/datetimes.py index 1ec3814c88f8d..1265bb469d7eb 100644 --- a/pandas/core/arrays/datetimes.py +++ b/pandas/core/arrays/datetimes.py @@ -2231,7 +2231,9 @@ def maybe_convert_dtype(data, copy: bool, tz: tzinfo | None = None): if is_float_dtype(data.dtype): # pre-2.0 we treated these as wall-times, inconsistent with ints - # GH#23675, GH#45573 deprecated to treat symmetrically with integer dtypes + # GH#23675, GH#45573 deprecated to treat symmetrically with integer dtypes. + # Note: data.astype(np.int64) fails ARM tests, see + # https://github.com/pandas-dev/pandas/issues/49468. data = data.astype("M8[ns]").view("i8") copy = False