Skip to content

Commit cb7b250

Browse files
author
maxime.c
committed
code review
1 parent a49ac91 commit cb7b250

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2177,8 +2177,15 @@ def _build_stream_slicer_from_partition_router(
21772177
parameters={},
21782178
)
21792179
elif isinstance(stream_slicer_model, dict):
2180-
# partition router comes from CustomRetrieverModel and has not been and therefore partition_router has not been parsed as a model
2181-
stream_slicer_model["$parameters"]["stream_name"] = stream_name
2180+
# partition router comes from CustomRetrieverModel therefore has not been parsed as a model
2181+
params = stream_slicer_model.get("$parameters")
2182+
if not isinstance(params, dict):
2183+
params = {}
2184+
stream_slicer_model["$parameters"] = params
2185+
2186+
if stream_name is not None:
2187+
params["stream_name"] = stream_name
2188+
21822189
return self._create_nested_component( # type: ignore[no-any-return] # There is no guarantee that this will return a stream slicer. If not, we expect an AttributeError during the call to `stream_slices`
21832190
model,
21842191
"partition_router",

0 commit comments

Comments
 (0)