Skip to content

Commit 7d5023b

Browse files
committed
Only try datetime_as_string on datetime kinded numpy arrays
1 parent fcba8a7 commit 7d5023b

File tree

1 file changed

+1
-1
lines changed
  • packages/python/plotly/_plotly_utils

1 file changed

+1
-1
lines changed

Diff for: packages/python/plotly/_plotly_utils/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def encode_as_numpy(obj):
184184

185185
if obj is numpy.ma.core.masked:
186186
return float("nan")
187-
elif isinstance(obj, numpy.ndarray):
187+
elif isinstance(obj, numpy.ndarray) and obj.dtype.kind == "M":
188188
try:
189189
return numpy.datetime_as_string(obj).tolist()
190190
except TypeError:

0 commit comments

Comments
 (0)