We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 75da4a3 commit 41ec4e8Copy full SHA for 41ec4e8
plotly/utils.py
@@ -11,6 +11,7 @@
11
import sys
12
import threading
13
import re
14
+import datetime
15
16
### incase people are using threading, we lock file reads
17
lock = threading.Lock()
@@ -101,7 +102,14 @@ def datetimeJSONEncoder(self, obj):
101
102
depending on what non-zero resolution was provided
103
'''
104
try:
105
+ import pandas
106
+ pandas_importable = True
107
except:
108
+ pandas_importable = False
109
+
110
+ if pandas_importable and obj is pandas.NaT:
111
+ return None
112
113
if isinstance(obj, (datetime.datetime, datetime.date)):
114
if obj.microsecond != 0:
115
return obj.strftime('%Y-%m-%d %H:%M:%S.%f')
0 commit comments