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

Allow optional attributes to be entirely absent from HubSpot #327

Merged
merged 1 commit into from
Jan 2, 2024

Conversation

@marcospri marcospri force-pushed the fix-mapping-optional branch from 18c0cd5 to 27492af Compare January 2, 2024 14:16
@@ -338,7 +338,7 @@ def _get_objects(cls, accessor, fields: Iterable[Field]):
def _map_item(cls, item, fields: Iterable[Field]):
result = {}
for field in fields:
value = item.properties[field.hs_field] or None
value = item.properties.get(field.hs_field) or None
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not equivalent to just the get. The or here coerces falsy values (0, None, '') all to None. The tests expect this behaviour.

@marcospri marcospri requested a review from acelaya January 2, 2024 14:18
@marcospri marcospri merged commit b8b3189 into main Jan 2, 2024
6 checks passed
@marcospri marcospri deleted the fix-mapping-optional branch January 2, 2024 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants