Skip to content

Commit

Permalink
source-hubspot-native: don't serialize empty object for empty propert…
Browse files Browse the repository at this point in the history
…iesWithHistory

Omit the frivolous empty object for an empty propertiesWithHistory, so that it
is not picked up by schema inference. The default setting will not capture
propertiesWithHistory so having this empty object in every document would likely
be confusing.
  • Loading branch information
williamhbaker committed Jan 9, 2025
1 parent 04590ba commit 1c2c427
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source-hubspot-native/source_hubspot_native/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ def _post_init(self) -> Self:
self.propertiesWithHistory = {
k: v for k, v in self.propertiesWithHistory.items() if len(v)
}
if len(self.propertiesWithHistory) == 0:
delattr(self, "propertiesWithHistory")

# If the model has attached inline associations,
# hoist them to corresponding arrays. Then clear associations.
Expand Down

0 comments on commit 1c2c427

Please sign in to comment.