Skip to content

Commit

Permalink
Don't emit SCHEMA messages for skipped streams
Browse files Browse the repository at this point in the history
  • Loading branch information
DouweM committed Jul 31, 2023
1 parent 64f61f6 commit f1f960e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion samples/sample_mapper/mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit f1f960e

Please sign in to comment.