@@ -163,7 +163,6 @@ def read_blob(self, n_bytes=None):
163
163
"F" : self .read_recarray , # numpy array with fields, including recarrays
164
164
"d" : self .read_decimal , # a decimal
165
165
"t" : self .read_datetime , # date, time, or datetime
166
- "T" : self .read_int64_datetime , # np.datetime64
167
166
"u" : self .read_uuid , # UUID
168
167
}[data_structure_code ]
169
168
except KeyError :
@@ -199,15 +198,13 @@ def pack_blob(self, obj):
199
198
return self .pack_float (obj )
200
199
if isinstance (obj , np .ndarray ) and obj .dtype .fields :
201
200
return self .pack_recarray (np .array (obj ))
202
- if isinstance (obj , np .number ):
201
+ if isinstance (obj , ( np .number , np . datetime64 ) ):
203
202
return self .pack_array (np .array (obj ))
204
203
if isinstance (obj , (bool , np .bool_ )):
205
204
return self .pack_array (np .array (obj ))
206
205
if isinstance (obj , (float , int , complex )):
207
206
return self .pack_array (np .array (obj ))
208
- if isinstance (
209
- obj , (datetime .datetime , datetime .date , datetime .time , np .datetime64 )
210
- ):
207
+ if isinstance (obj , (datetime .datetime , datetime .date , datetime .time )):
211
208
return self .pack_datetime (obj )
212
209
if isinstance (obj , Decimal ):
213
210
return self .pack_decimal (obj )
@@ -538,18 +535,12 @@ def read_datetime(self):
538
535
)
539
536
return time and date and datetime .datetime .combine (date , time ) or time or date
540
537
541
- def read_int64_datetime (self ):
542
- data = self .read_value ()
543
- return data .astype ("datetime64[us]" )
544
-
545
538
@staticmethod
546
539
def pack_datetime (d ):
547
540
if isinstance (d , datetime .datetime ):
548
541
date , time = d .date (), d .time ()
549
542
elif isinstance (d , datetime .date ):
550
543
date , time = d , None
551
- elif isinstance (d , np .datetime64 ):
552
- return b"T" + (d .astype ("datetime64[us]" )).tobytes ()
553
544
else :
554
545
date , time = None , d
555
546
return b"t" + (
0 commit comments