Skip to content

Commit

Permalink
fix(event-sources): handle dynamodb null type as none, not bool (#929)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Brewer authored Dec 30, 2021
1 parent bdf307b commit f6db802
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,13 @@ def ns_value(self) -> Optional[List[str]]:
return self.get("NS")

@property
def null_value(self) -> Optional[bool]:
def null_value(self) -> None:
"""An attribute of type Null.
Example:
>>> {"NULL": True}
"""
item = self.get("NULL")
return None if item is None else bool(item)
return None

@property
def s_value(self) -> Optional[str]:
Expand Down
1 change: 1 addition & 0 deletions tests/functional/test_data_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ def test_dynamo_attribute_value_null_value():
attribute_value = AttributeValue(example_attribute_value)

assert attribute_value.get_type == AttributeValueType.Null
assert attribute_value.null_value is None
assert attribute_value.null_value == attribute_value.get_value


Expand Down

0 comments on commit f6db802

Please sign in to comment.