Skip to content

Commit d41d303

Browse files
committed
Fix datetime64 dtype assertion for big-endian platforms
The test hardcoded the little-endian dtype literal "<M8[ns]", which fails on big-endian platforms where numpy naturally produces big-endian arrays from this conversion path. Compare against dates_array.dtype directly instead, which is endian-agnostic.
1 parent 224e133 commit d41d303

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎tests/test_plotly_utils/validators/test_pandas_series_input.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def test_data_array_validator_dates_series(
180180
assert isinstance(res, np.ndarray)
181181

182182
# Check dtype
183-
assert res.dtype == "<M8[ns]"
183+
assert res.dtype == dates_array.dtype
184184

185185
# Check values
186186
np.testing.assert_array_equal(res, dates_array)
@@ -196,7 +196,7 @@ def test_data_array_validator_dates_dataframe(
196196
assert isinstance(res, np.ndarray)
197197

198198
# Check dtype
199-
assert res.dtype == "<M8[ns]"
199+
assert res.dtype == dates_array.dtype
200200

201201
# Check values
202202
np.testing.assert_array_equal(res, dates_array.reshape(len(dates_array), 1))

0 commit comments

Comments
 (0)