Skip to content

Commit

Permalink
Move sink exists assertion to be compatible with stream_maps
Browse files Browse the repository at this point in the history
  • Loading branch information
JCotton1123 committed Aug 6, 2024
1 parent c0cdafc commit 9521c82
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion singer_sdk/target_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@ def _process_record_message(self, message_dict: dict) -> None:
self._assert_line_requires(message_dict, requires={"stream", "record"})

stream_name = message_dict["stream"]
self._assert_sink_exists(stream_name)
if not stream_name in self.mapper.stream_maps:
self._assert_sink_exists(stream_name)

for stream_map in self.mapper.stream_maps[stream_name]:
raw_record = copy.copy(message_dict["record"])
Expand All @@ -343,6 +344,7 @@ def _process_record_message(self, message_dict: dict) -> None:
# Record was filtered out by the map transform
continue

self._assert_sink_exists(stream_map.stream_alias)
sink = self.get_sink(stream_map.stream_alias, record=transformed_record)
context = sink._get_context(transformed_record) # noqa: SLF001
if sink.include_sdc_metadata_properties:
Expand Down

0 comments on commit 9521c82

Please sign in to comment.