From 5b51227881692907e2785e9d92fa27ae966faace Mon Sep 17 00:00:00 2001 From: Tobias Cadee Date: Wed, 27 Mar 2024 14:57:04 +0100 Subject: [PATCH] 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 f41d3d97fb..54086363ed 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 != None: + self.logger.warning("No schema for record field '%s'", key) continue datelike_type = get_datelike_property_type(schema["properties"][key]) if datelike_type: