Skip to content

Commit

Permalink
fix(targets): Added a condition to the No schema for record field w…
Browse files Browse the repository at this point in the history
…arning (#2348)

fix: 🐛 add a condition to the `No schema for record field` warning

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 authored Apr 3, 2024
1 parent 101ffc8 commit e64e108
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 is not 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 e64e108

Please # to comment.