Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(event-sources): handle dynamodb null type as none, not bool #929

Merged
merged 3 commits into from
Dec 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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