If I remove storage=serialization, it works fine. But if I leave it in, I get an error:
Exception has occurred: TypeError
isinstance() arg 2 must be a type or tuple of types
File "C:\Projects\jbhs-scripts\roles\auto-download\files\src\main.py", line 52, in <module>
db.insert({'int': 1, 'char': 'a'})
My serialization class is pretty simple. I don't think that's this issue but here is the code:
from datetime import datetime
from tinydb_serialization import Serializer
import arrow
class DateTimeSerializer(Serializer):
OBJ_CLASS = arrow # The class this serializer handles
def encode(self, obj):
return obj.isoformat().replace("+00:00", "Z")
def decode(self, s):
return arrow.get(s)
I am having trouble inserting or updating while using serialization. Here is my code:
If I remove
storage=serialization
, it works fine. But if I leave it in, I get an error:My serialization class is pretty simple. I don't think that's this issue but here is the code:
I am using Python version 3.6.0