Rob Weber 2019-08-30 15:26:52 -05:00
parent 495ecb1048
commit b9e0424ea5

View File

@ -880,6 +880,12 @@ class PythonPrimitiveToStoneDecoder(object):
if isinstance(data_type, bv.Timestamp): if isinstance(data_type, bv.Timestamp):
try: try:
ret = datetime.datetime.strptime(val, data_type.format) ret = datetime.datetime.strptime(val, data_type.format)
except:
#datetime.datetime.strptime(val, data_type.format) returned NoneType. Trying alterntive
pass
try:
ret = datetime.datetime(*(time.strptime(val, data_type.format)[0:6]))
except (TypeError, ValueError) as e: except (TypeError, ValueError) as e:
raise bv.ValidationError(e.args[0]) raise bv.ValidationError(e.args[0])
elif isinstance(data_type, bv.Bytes): elif isinstance(data_type, bv.Bytes):