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,