Open Ted-Barrett opened 3 weeks ago
Unfortunately this check simply won't let you have that: https://github.com/pynamodb/PynamoDB/blob/4b8630409b46cd57ccbb08658c71bda339c9df7e/pynamodb/attributes.py#L431-L432
(Curiously, the NULL
DynamoDB attribute value would also have the same effect, making it indistinguishable from absence of value. A shame.)
Typically I'd override a model's deserialize
if I want the opportunity to work with the raw data before field-by-field deserialization.
I would like to handle null values when deserializing. I have the following custom attribute:
being used in a model:
If the field has data in it, I get the runtime error
STOP!!
as expected.If the field is empty, there is no such error, and
e.test_field
isNone
.How can I handle the behaviour when a value is null?