Skip to content

Commit

Permalink
Merge branch 'lazebnyi/add-state-delegating-retriever' of github.com:…
Browse files Browse the repository at this point in the history
…airbytehq/airbyte-python-cdk into lazebnyi/add-state-delegating-retriever
  • Loading branch information
lazebnyi committed Mar 7, 2025
2 parents 63b156e + 571ffa9 commit 5bf46a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2766,7 +2766,9 @@ def create_state_delegating_retriever(
client_side_incremental_sync: Optional[Dict[str, Any]] = None,
transformations: List[RecordTransformation],
) -> Optional[StateDelegatingRetriever]:
if not isinstance(stream_slicer, DatetimeBasedCursor) and not isinstance(stream_slicer, PerPartitionCursor):
if not isinstance(stream_slicer, DatetimeBasedCursor) and not isinstance(
stream_slicer, PerPartitionCursor
):
raise ValueError("StateDelegatingRetriever requires a DatetimeBasedCursor")

full_refresh_retriever = self._create_component_from_model(
Expand Down Expand Up @@ -2797,7 +2799,7 @@ def create_state_delegating_retriever(
full_data_retriever=full_refresh_retriever,
incremental_data_retriever=incremental_retriever,
cursor=stream_slicer,
started_with_state=bool(self._connector_state_manager.get_stream_state(name, None))
started_with_state=bool(self._connector_state_manager.get_stream_state(name, None)),
)

def _create_async_job_status_mapping(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ def __setattr__(self, name: str, value: Any) -> None:
@property
def retriever(self) -> Retriever:
return (
self.incremental_data_retriever
if self.started_with_state
else self.full_data_retriever
self.incremental_data_retriever if self.started_with_state else self.full_data_retriever
)

@property
Expand Down

0 comments on commit 5bf46a7

Please sign in to comment.