Skip to content

Commit

Permalink
chore: Handle sample mapper's handling of removed streams
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Jan 31, 2024
1 parent 631d5df commit 7d7edb7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions 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,13 +90,15 @@ def map_schema_message(
message_dict.get("key_properties", []),
)
for stream_map in self.mapper.stream_maps[stream_id]:
schema_message = singer.SchemaMessage(
if isinstance(stream_map, RemoveRecordTransform):
# Don't emit schema if the stream's records are all ignored.
continue
yield singer.SchemaMessage(
stream_map.stream_alias,
stream_map.transformed_schema,
stream_map.transformed_key_properties,
message_dict.get("bookmark_keys", []),
)
yield schema_message

def map_record_message(
self,
Expand Down

0 comments on commit 7d7edb7

Please sign in to comment.