Skip to content

Commit 59d3ba5

Browse files
spencerkclarkdcherian
authored andcommitted
Explicitly convert result of pd.to_datetime to a timezone-naive type (#3688)
1 parent 1689db4 commit 59d3ba5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xarray/tests/test_coding_times.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ def test_cf_datetime_nan(num_dates, units, expected_list):
451451
warnings.filterwarnings("ignore", "All-NaN")
452452
actual = coding.times.decode_cf_datetime(num_dates, units)
453453
# use pandas because numpy will deprecate timezone-aware conversions
454-
expected = pd.to_datetime(expected_list)
454+
expected = pd.to_datetime(expected_list).to_numpy(dtype="datetime64[ns]")
455455
assert_array_equal(expected, actual)
456456

457457

0 commit comments

Comments
 (0)