Skip to content

Commit

Permalink
fix: 🐛 add a condition to the No schema for record field warning
Browse files Browse the repository at this point in the history
If schema flattening is enabled but a value for a key in the record which is flattened is None, this warning is returned because the record can not be flattened and then the key is not in the schema. This can be avoided by checking if the value is None. If it is None the record field actually does not exist so we do not need a warning.
  • Loading branch information
tobiascadee committed Mar 27, 2024
1 parent acb7487 commit 5b51227
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion singer_sdk/sinks/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,8 @@ def _parse_timestamps_in_record(
"""
for key, value in record.items():
if key not in schema["properties"]:
self.logger.warning("No schema for record field '%s'", key)
if value != None:
self.logger.warning("No schema for record field '%s'", key)
continue
datelike_type = get_datelike_property_type(schema["properties"][key])
if datelike_type:
Expand Down

0 comments on commit 5b51227

Please # to comment.