From 654d8548a51772d1a66d64fbd7e7bc3a87dd7500 Mon Sep 17 00:00:00 2001 From: Justin Phillips Date: Fri, 25 Jun 2021 11:20:17 -0700 Subject: [PATCH] null_check --- pynamodb/attributes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pynamodb/attributes.py b/pynamodb/attributes.py index 2cd5da6d0..18ba40f91 100644 --- a/pynamodb/attributes.py +++ b/pynamodb/attributes.py @@ -1009,14 +1009,14 @@ def __setattr__(self, name, value): else: super().__setattr__(name, value) - def serialize(self, values): + def serialize(self, values, *, null_check: bool = True): if not isinstance(values, type(self)): # Copy the values onto an instance of the class for serialization. instance = type(self)() instance.attribute_values = {} # clear any defaults instance._set_attributes(**values) values = instance - rval = AttributeContainer.serialize(values) + rval = AttributeContainer._container_serialize(values, null_check=null_check) for attr_name in values: if attr_name not in self.get_attributes(): v = values[attr_name]