Skip to content

Commit 956ab46

Browse files
committed
Add lazy read to constructor
1 parent 2607bcf commit 956ab46

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2704,6 +2704,27 @@ def create_simple_retriever(
27042704
model.ignore_stream_slicer_parameters_on_paginated_requests or False
27052705
)
27062706

2707+
if model.lazy_read_pointer and not bool(self._connector_state_manager.get_stream_state(name, None)):
2708+
lazy_read_pointer = [InterpolatedString.create(path, parameters=model.parameters or {}) for path in model.lazy_read_pointer]
2709+
partition_router = self._create_component_from_model(model=model.partition_router, config=config)
2710+
stream_slicer = self._create_component_from_model(model=incremental_sync, config=config) if incremental_sync else SinglePartitionRouter(parameters={})
2711+
2712+
return LazySimpleRetriever(
2713+
name=name,
2714+
paginator=paginator,
2715+
primary_key=primary_key,
2716+
requester=requester,
2717+
record_selector=record_selector,
2718+
stream_slicer=stream_slicer,
2719+
request_option_provider=request_options_provider,
2720+
cursor=cursor,
2721+
config=config,
2722+
ignore_stream_slicer_parameters_on_paginated_requests=ignore_stream_slicer_parameters_on_paginated_requests,
2723+
parameters=model.parameters or {},
2724+
partition_router=partition_router,
2725+
lazy_read_pointer=lazy_read_pointer,
2726+
)
2727+
27072728
if self._limit_slices_fetched or self._emit_connector_builder_messages:
27082729
return SimpleRetrieverTestReadDecorator(
27092730
name=name,

0 commit comments

Comments
 (0)