Default De-serialization Functions

SQLAthanor applies default de-serialization functions to process your model attributes before assigning their de-serialized value to your model attribute. These default functions primarily exist to validate that a value assigned to a given attribute is valid given that attribute’s SQLAlchemy Data Type.

The table below shows the data type that is assigned to a model attribute by the default de-serialization function based on the attribute’s data type.

Note

If the default de-serializer function cannot coerce the value extracted from your serialized data to either None or the expected data type, SQLAthanor will raise ValueDeserializationError.

Data Types CSV JSON YAML dict
None        
int int int int
bool Boolean BOOLEAN bool bool bool bool
str str str str
oracle.BINARY_FLOAT
float float float float
validator_collection.validators.numeric() validator_collection.validators.numeric() validator_collection.validators.numeric() validator_collection.validators.numeric()
decimal.Decimal decimal.Decimal decimal.Decimal decimal.Decimal
datetime.date datetime.date datetime.date datetime.date
datetime.datetime datetime.datetime datetime.datetime datetime.datetime
datetime.time datetime.time datetime.time datetime.time
mysql.YEAR        
datetime.timedelta datetime.timedelta datetime.timedelta datetime.timedelta
bytes bytes bytes bytes
       
postgresql.UUID uuid.UUID uuid.UUID uuid.UUID uuid.UUID
bool bool bool bool
       
postgresql.MACADDR str str str str
UnsupportedDeserializationError str str str
UnsupportedDeserializationError      
UnsupportedDeserializationError iterable iterable iterable
UnsupportedDeserializationError UnsupportedDeserializationError UnsupportedDeserializationError UnsupportedDeserializationError