File tree Expand file tree Collapse file tree 1 file changed +2
-16
lines changed
Expand file tree Collapse file tree 1 file changed +2
-16
lines changed Original file line number Diff line number Diff line change 2020# software solely pursuant to the terms of the relevant commercial agreement.
2121
2222
23- import calendar
2423import heapq
2524import io
2625import logging
3029import ssl
3130import threading
3231from base64 import b64encode
33- from datetime import date , datetime , timezone
32+ from datetime import datetime , timezone
3433from decimal import Decimal
3534from time import time
3635from urllib .parse import urlparse
37- from uuid import UUID
3836
3937import orjson
4038import urllib3
@@ -95,21 +93,9 @@ def cratedb_json_encoder(obj):
9593 Encoder function for orjson.
9694
9795 https://github.com/ijl/orjson#default
98- https://github.com/ijl/orjson#opt_passthrough_datetime
9996 """
100- if isinstance (obj , (Decimal , UUID )):
97+ if isinstance (obj , (Decimal ,)):
10198 return str (obj )
102- if isinstance (obj , datetime ):
103- if obj .tzinfo is not None :
104- delta = obj - epoch_aware
105- else :
106- delta = obj - epoch_naive
107- return int (
108- delta .microseconds / 1000.0
109- + (delta .seconds + delta .days * 24 * 3600 ) * 1000.0
110- )
111- if isinstance (obj , date ):
112- return calendar .timegm (obj .timetuple ()) * 1000
11399 return obj
114100
115101
You can’t perform that action at this time.
0 commit comments