Skip to content

Commit c320c46

Browse files
committed
move from object to datetime dtype in _plotly_utils/test/validators
1 parent d94cbf7 commit c320c46

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

packages/python/plotly/_plotly_utils/tests/validators/test_pandas_series_input.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,13 @@ def color_categorical_pandas(request, pandas_type):
7373
def dates_array(request):
7474
return np.array(
7575
[
76-
datetime(year=2013, month=10, day=10),
77-
datetime(year=2013, month=11, day=10),
78-
datetime(year=2013, month=12, day=10),
79-
datetime(year=2014, month=1, day=10),
80-
datetime(year=2014, month=2, day=10),
81-
]
76+
"2013-10-10",
77+
"2013-11-10",
78+
"2013-12-10",
79+
"2014-01-10",
80+
"2014-02-10",
81+
],
82+
dtype="datetime64[ns]",
8283
)
8384

8485

@@ -183,7 +184,7 @@ def test_data_array_validator_dates_series(
183184
assert isinstance(res, np.ndarray)
184185

185186
# Check dtype
186-
assert res.dtype == "object"
187+
assert res.dtype == "<M8[ns]"
187188

188189
# Check values
189190
np.testing.assert_array_equal(res, dates_array)
@@ -200,7 +201,7 @@ def test_data_array_validator_dates_dataframe(
200201
assert isinstance(res, np.ndarray)
201202

202203
# Check dtype
203-
assert res.dtype == "object"
204+
assert res.dtype == "<M8[ns]"
204205

205206
# Check values
206207
np.testing.assert_array_equal(res, dates_array.reshape(len(dates_array), 1))

0 commit comments

Comments
 (0)