Skip to content

Commit d8222f3

Browse files
committed
Update child_stat to has_parent_state
1 parent 8f2554e commit d8222f3

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2728,7 +2728,7 @@ def create_state_delegating_stream(
27282728
self,
27292729
model: StateDelegatingStreamModel,
27302730
config: Config,
2731-
child_state: Optional[MutableMapping[str, Any]] = None,
2731+
has_parent_state: Optional[bool] = None,
27322732
**kwargs: Any,
27332733
) -> DeclarativeStream:
27342734
if (
@@ -2741,7 +2741,7 @@ def create_state_delegating_stream(
27412741

27422742
stream_model = (
27432743
model.incremental_stream
2744-
if self._connector_state_manager.get_stream_state(model.name, None) or child_state
2744+
if self._connector_state_manager.get_stream_state(model.name, None) or has_parent_state
27452745
else model.full_refresh_stream
27462746
)
27472747

@@ -3000,13 +3000,15 @@ def _create_message_repository_substream_wrapper(
30003000
self._evaluate_log_level(self._emit_connector_builder_messages),
30013001
),
30023002
)
3003-
child_state = (
3003+
3004+
# This flag will be used exclusively for StateDelegatingStream when a parent stream is created
3005+
has_parent_state = bool(
30043006
self._connector_state_manager.get_stream_state(kwargs.get("stream_name", ""), None)
3005-
if model.incremental_dependency or False
3006-
else None
3007+
if model.incremental_dependency
3008+
else False
30073009
)
30083010
return substream_factory._create_component_from_model(
3009-
model=model, config=config, child_state=child_state, **kwargs
3011+
model=model, config=config, has_parent_state=has_parent_state, **kwargs
30103012
)
30113013

30123014
@staticmethod

0 commit comments

Comments
 (0)