From f1f960e86c711b843c288c621e4046d1da51cf8c Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Tue, 18 Apr 2023 21:23:24 -0600 Subject: [PATCH] Don't emit SCHEMA messages for skipped streams --- samples/sample_mapper/mapper.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/samples/sample_mapper/mapper.py b/samples/sample_mapper/mapper.py index e079bac08..4d2e4c36e 100644 --- a/samples/sample_mapper/mapper.py +++ b/samples/sample_mapper/mapper.py @@ -7,7 +7,7 @@ import singer_sdk._singerlib as singer import singer_sdk.typing as th from singer_sdk.helpers._util import utc_now -from singer_sdk.mapper import PluginMapper +from singer_sdk.mapper import PluginMapper, RemoveRecordTransform from singer_sdk.mapper_base import InlineMapper if t.TYPE_CHECKING: @@ -90,6 +90,10 @@ def map_schema_message( message_dict.get("key_properties", []), ) for stream_map in self.mapper.stream_maps[stream_id]: + if isinstance(stream_map, RemoveRecordTransform): + # Don't emit schema if the stream's records are all ignored. + continue + schema_message = singer.SchemaMessage( stream_map.stream_alias, stream_map.transformed_schema,