Skip to content

Commit

Permalink
Don't rebuild stream_maps[stream_name] if stream is already known
Browse files Browse the repository at this point in the history
  • Loading branch information
DouweM committed Jul 31, 2023
1 parent 611d50d commit 64f61f6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions singer_sdk/mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,11 +664,14 @@ def register_raw_stream_schema( # noqa: PLR0912, C901
if stream_name in self.stream_maps:
primary_mapper = self.stream_maps[stream_name][0]
if (
primary_mapper.raw_schema != schema
or primary_mapper.raw_key_properties != key_properties
isinstance(primary_mapper, self.default_mapper_type)
and primary_mapper.raw_schema == schema
and primary_mapper.raw_key_properties == key_properties
):
# Unload/reset stream maps if schema or key properties have changed.
self.stream_maps.pop(stream_name)
return

# Unload/reset stream maps if schema or key properties have changed.
self.stream_maps.pop(stream_name)

if stream_name not in self.stream_maps:
# The 0th mapper should be the same-named treatment.
Expand Down

0 comments on commit 64f61f6

Please sign in to comment.