Skip to content

Commit decc557

Browse files
author
maxime.c
committed
format
1 parent c078395 commit decc557

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2170,7 +2170,7 @@ def _build_incremental_cursor(
21702170
)
21712171

21722172
if model.incremental_sync and (
2173-
stream_slicer and not isinstance(stream_slicer, SinglePartitionRouter)
2173+
stream_slicer and not isinstance(stream_slicer, SinglePartitionRouter)
21742174
):
21752175
if model.retriever.type == "AsyncRetriever":
21762176
stream_name = model.name or ""
@@ -2244,7 +2244,11 @@ def _build_concurrent_cursor(
22442244
else:
22452245
state_transformations = []
22462246

2247-
if model.incremental_sync and stream_slicer and not isinstance(stream_slicer, SinglePartitionRouter):
2247+
if (
2248+
model.incremental_sync
2249+
and stream_slicer
2250+
and not isinstance(stream_slicer, SinglePartitionRouter)
2251+
):
22482252
return self.create_concurrent_cursor_from_perpartition_cursor( # type: ignore # This is a known issue that we are creating and returning a ConcurrentCursor which does not technically implement the (low-code) StreamSlicer. However, (low-code) StreamSlicer and ConcurrentCursor both implement StreamSlicer.stream_slices() which is the primary method needed for checkpointing
22492253
state_manager=self._connector_state_manager,
22502254
model_type=DatetimeBasedCursorModel,

unit_tests/connector_builder/test_connector_builder_handler.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,11 @@ def test_config_update() -> None:
785785
"refresh_token": "a refresh token",
786786
}
787787
source = ConcurrentDeclarativeSource(
788-
catalog=None, config=config, state=None, source_config=manifest, emit_connector_builder_messages=True
788+
catalog=None,
789+
config=config,
790+
state=None,
791+
source_config=manifest,
792+
emit_connector_builder_messages=True,
789793
)
790794

791795
refresh_request_response = {

0 commit comments

Comments
 (0)