From e64e1087cd654dee33a061673eb453fb5b558b44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Cad=C3=A9e?= Date: Wed, 3 Apr 2024 08:08:35 +0200 Subject: [PATCH] fix(targets): Added a condition to the `No schema for record field` warning (#2348) fix: :bug: 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. --- singer_sdk/sinks/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/singer_sdk/sinks/core.py b/singer_sdk/sinks/core.py index f41d3d97f..0d4b1c2d9 100644 --- a/singer_sdk/sinks/core.py +++ b/singer_sdk/sinks/core.py @@ -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: