You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to write a custom serializer that does not serialize functions. Assuming returning None would avoid serialization, I tried:
def custom_serializer(key, value):
if callable(value):
# If value is a function, return None to exclude it from serialization
return None
else:
# Serialize non-function values using the default pickle serializer
return pickle.dumps(value)
However, this does not work due to an sql error sqlite3.ProgrammingError: Error binding parameter 2: type 'function' is not supported. The above serializeronly works only if the serializer returns not None.
I am not sure if this is an actual issue or whether I am using the wrong appoarch?
The text was updated successfully, but these errors were encountered:
I tried to write a custom serializer that does not serialize functions. Assuming returning None would avoid serialization, I tried:
However, this does not work due to an sql error
sqlite3.ProgrammingError: Error binding parameter 2: type 'function' is not supported
. The above serializeronly works only if the serializer returns not None.I am not sure if this is an actual issue or whether I am using the wrong appoarch?
The text was updated successfully, but these errors were encountered: