Skip to content

Commit 340aed3

Browse files
committed
Only try datetime_as_string on datetime kinded numpy arrays
1 parent 84ba4b5 commit 340aed3

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
@@ -186,7 +186,7 @@ def encode_as_numpy(obj):
186186

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

0 commit comments

Comments
 (0)