airbyte-cdk 6.7.1__py3-none-any.whl → 6.7.1.dev0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,6 +49,7 @@ from airbyte_cdk.sources.streams.concurrent.abstract_stream import AbstractStrea
49
49
  from airbyte_cdk.sources.streams.concurrent.availability_strategy import (
50
50
  AlwaysAvailableAvailabilityStrategy,
51
51
  )
52
+ from airbyte_cdk.sources.streams.concurrent.cursor import FinalStateCursor
52
53
  from airbyte_cdk.sources.streams.concurrent.default_stream import DefaultStream
53
54
  from airbyte_cdk.sources.streams.concurrent.helpers import get_primary_key_from_stream
54
55
  from airbyte_cdk.sources.types import Config, StreamState
@@ -69,6 +70,15 @@ class ConcurrentDeclarativeSource(ManifestDeclarativeSource, Generic[TState]):
69
70
  component_factory: Optional[ModelToComponentFactory] = None,
70
71
  **kwargs: Any,
71
72
  ) -> None:
73
+ # To reduce the complexity of the concurrent framework, we are not enabling RFR with synthetic
74
+ # cursors. We do this by no longer automatically instantiating RFR cursors when converting
75
+ # the declarative models into runtime components. Concurrent sources will continue to checkpoint
76
+ # incremental streams running in full refresh.
77
+ component_factory = component_factory or ModelToComponentFactory(
78
+ emit_connector_builder_messages=emit_connector_builder_messages,
79
+ disable_resumable_full_refresh=True,
80
+ )
81
+
72
82
  super().__init__(
73
83
  source_config=source_config,
74
84
  debug=debug,
@@ -191,13 +201,24 @@ class ConcurrentDeclarativeSource(ManifestDeclarativeSource, Generic[TState]):
191
201
  # these legacy Python streams the way we do low-code streams to determine if they are concurrent compatible,
192
202
  # so we need to treat them as synchronous
193
203
  if isinstance(declarative_stream, DeclarativeStream):
194
- datetime_based_cursor_component_definition = name_to_stream_mapping[
204
+ incremental_sync_component_definition = name_to_stream_mapping[
195
205
  declarative_stream.name
196
206
  ].get("incremental_sync")
197
207
 
208
+ partition_router_component_definition = (
209
+ name_to_stream_mapping[declarative_stream.name]
210
+ .get("retriever")
211
+ .get("partition_router")
212
+ )
213
+
214
+ is_substream_without_incremental = (
215
+ partition_router_component_definition
216
+ and not incremental_sync_component_definition
217
+ )
218
+
198
219
  if (
199
- datetime_based_cursor_component_definition
200
- and datetime_based_cursor_component_definition.get("type", "")
220
+ incremental_sync_component_definition
221
+ and incremental_sync_component_definition.get("type", "")
201
222
  == DatetimeBasedCursorModel.__name__
202
223
  and self._stream_supports_concurrent_partition_processing(
203
224
  declarative_stream=declarative_stream
@@ -213,7 +234,7 @@ class ConcurrentDeclarativeSource(ManifestDeclarativeSource, Generic[TState]):
213
234
  self._constructor.create_concurrent_cursor_from_datetime_based_cursor(
214
235
  state_manager=state_manager,
215
236
  model_type=DatetimeBasedCursorModel,
216
- component_definition=datetime_based_cursor_component_definition,
237
+ component_definition=incremental_sync_component_definition,
217
238
  stream_name=declarative_stream.name,
218
239
  stream_namespace=declarative_stream.namespace,
219
240
  config=config or {},
@@ -247,6 +268,41 @@ class ConcurrentDeclarativeSource(ManifestDeclarativeSource, Generic[TState]):
247
268
  cursor=cursor,
248
269
  )
249
270
  )
271
+ elif is_substream_without_incremental and hasattr(
272
+ declarative_stream.retriever, "stream_slicer"
273
+ ):
274
+ partition_generator = StreamSlicerPartitionGenerator(
275
+ DeclarativePartitionFactory(
276
+ declarative_stream.name,
277
+ declarative_stream.get_json_schema(),
278
+ self._retriever_factory(
279
+ name_to_stream_mapping[declarative_stream.name],
280
+ config,
281
+ {},
282
+ ),
283
+ self.message_repository,
284
+ ),
285
+ declarative_stream.retriever.stream_slicer,
286
+ )
287
+
288
+ final_state_cursor = FinalStateCursor(
289
+ stream_name=declarative_stream.name,
290
+ stream_namespace=declarative_stream.namespace,
291
+ message_repository=self.message_repository,
292
+ )
293
+
294
+ concurrent_streams.append(
295
+ DefaultStream(
296
+ partition_generator=partition_generator,
297
+ name=declarative_stream.name,
298
+ json_schema=declarative_stream.get_json_schema(),
299
+ availability_strategy=AlwaysAvailableAvailabilityStrategy(),
300
+ primary_key=get_primary_key_from_stream(declarative_stream.primary_key),
301
+ cursor_field=None,
302
+ logger=self.logger,
303
+ cursor=final_state_cursor,
304
+ )
305
+ )
250
306
  else:
251
307
  synchronous_streams.append(declarative_stream)
252
308
  else:
@@ -384,6 +384,7 @@ class ModelToComponentFactory:
384
384
  emit_connector_builder_messages: bool = False,
385
385
  disable_retries: bool = False,
386
386
  disable_cache: bool = False,
387
+ disable_resumable_full_refresh: bool = False,
387
388
  message_repository: Optional[MessageRepository] = None,
388
389
  ):
389
390
  self._init_mappings()
@@ -392,6 +393,7 @@ class ModelToComponentFactory:
392
393
  self._emit_connector_builder_messages = emit_connector_builder_messages
393
394
  self._disable_retries = disable_retries
394
395
  self._disable_cache = disable_cache
396
+ self._disable_resumable_full_refresh = disable_resumable_full_refresh
395
397
  self._message_repository = message_repository or InMemoryMessageRepository( # type: ignore
396
398
  self._evaluate_log_level(emit_connector_builder_messages)
397
399
  )
@@ -1335,6 +1337,8 @@ class ModelToComponentFactory:
1335
1337
  if model.incremental_sync
1336
1338
  else None
1337
1339
  )
1340
+ elif self._disable_resumable_full_refresh:
1341
+ return stream_slicer
1338
1342
  elif stream_slicer:
1339
1343
  # For the Full-Refresh sub-streams, we use the nested `ChildPartitionResumableFullRefreshCursor`
1340
1344
  return PerPartitionCursor(
@@ -67,6 +67,7 @@ class DefaultStream(AbstractStream):
67
67
  name=self.name,
68
68
  json_schema=dict(self._json_schema),
69
69
  supported_sync_modes=[SyncMode.full_refresh],
70
+ is_resumable=False,
70
71
  )
71
72
 
72
73
  if self._namespace:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 6.7.1
3
+ Version: 6.7.1.dev0
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -62,7 +62,7 @@ airbyte_cdk/sources/declarative/checks/check_stream.py,sha256=dAA-UhmMj0WLXCkRQr
62
62
  airbyte_cdk/sources/declarative/checks/connection_checker.py,sha256=MBRJo6WJlZQHpIfOGaNOkkHUmgUl_4wDM6VPo41z5Ss,1383
63
63
  airbyte_cdk/sources/declarative/concurrency_level/__init__.py,sha256=5XUqrmlstYlMM0j6crktlKQwALek0uiz2D3WdM46MyA,191
64
64
  airbyte_cdk/sources/declarative/concurrency_level/concurrency_level.py,sha256=YIwCTCpOr_QSNW4ltQK0yUGWInI8PKNY216HOOegYLk,2101
65
- airbyte_cdk/sources/declarative/concurrent_declarative_source.py,sha256=XQVc7xMRffm9v4qwDMTGIfWzNB2pf9GvILB4MvB0icU,19818
65
+ airbyte_cdk/sources/declarative/concurrent_declarative_source.py,sha256=k2rHM3FIyoRUCZ7egwO36gd9fyX_J1ZokfAtpVzNvac,22641
66
66
  airbyte_cdk/sources/declarative/datetime/__init__.py,sha256=l9LG7Qm6e5r_qgqfVKnx3mXYtg1I9MmMjomVIPfU4XA,177
67
67
  airbyte_cdk/sources/declarative/datetime/datetime_parser.py,sha256=SX9JjdesN1edN2WVUVMzU_ptqp2QB1OnsnjZ4mwcX7w,2579
68
68
  airbyte_cdk/sources/declarative/datetime/min_max_datetime.py,sha256=8VZJP18eJLabSPP1XBSPDaagUBG6q1ynIiPJy3rE2mc,5344
@@ -109,7 +109,7 @@ airbyte_cdk/sources/declarative/parsers/__init__.py,sha256=ZnqYNxHsKCgO38IwB34RQ
109
109
  airbyte_cdk/sources/declarative/parsers/custom_exceptions.py,sha256=Rir9_z3Kcd5Es0-LChrzk-0qubAsiK_RSEnLmK2OXm8,553
110
110
  airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py,sha256=jVZ3ZV5YZrmDNIX5cM2mugXmnbH27zHRcD22_3oatpo,8454
111
111
  airbyte_cdk/sources/declarative/parsers/manifest_reference_resolver.py,sha256=IWUOdF03o-aQn0Occo1BJCxU0Pz-QILk5L67nzw2thw,6803
112
- airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=-CjcKFMKjWRjdVJg8lLJWOYFV--wcCSO6uCMObf4F78,95496
112
+ airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=juaH6szhQ2Tuyq9J7-vnB3ZfazqSdifxpQ5Ek6HzOlw,95712
113
113
  airbyte_cdk/sources/declarative/partition_routers/__init__.py,sha256=8uGos2u7TFTx_EJBdcjdUGn3Eyx6jUuEa1_VB8UP_dI,631
114
114
  airbyte_cdk/sources/declarative/partition_routers/cartesian_product_stream_slicer.py,sha256=c5cuVFM6NFkuQqG8Z5IwkBuwDrvXZN1CunUOM_L0ezg,6892
115
115
  airbyte_cdk/sources/declarative/partition_routers/list_partition_router.py,sha256=t7pRdFWfFWJtQQG19c9PVeMODyO2BknRTakpM5U9N-8,4844
@@ -246,7 +246,7 @@ airbyte_cdk/sources/streams/concurrent/abstract_stream_facade.py,sha256=QTry1QCB
246
246
  airbyte_cdk/sources/streams/concurrent/adapters.py,sha256=f2TmcQaDRN9ttiaD_wsgDCCXUG4C_UtIQy19yd49tp0,15176
247
247
  airbyte_cdk/sources/streams/concurrent/availability_strategy.py,sha256=xqErZU9v9QTe9Fv-MSJAICABs3Ke27mdA7QpgyFFj8g,2877
248
248
  airbyte_cdk/sources/streams/concurrent/cursor.py,sha256=D_kQxKAmIwgs3eoJeVZPTjMToRT1N2FGd2RR8RnpX90,20555
249
- airbyte_cdk/sources/streams/concurrent/default_stream.py,sha256=WdZYzION3q6nIhIIcpFqlovDcouOHdbnB0U1YIDP2Jk,3175
249
+ airbyte_cdk/sources/streams/concurrent/default_stream.py,sha256=K3rLMpYhS7nnmvwQ52lqBy7DQdFMJpvvT7sgBg_ckA8,3207
250
250
  airbyte_cdk/sources/streams/concurrent/exceptions.py,sha256=JOZ446MCLpmF26r9KfS6OO_6rGjcjgJNZdcw6jccjEI,468
251
251
  airbyte_cdk/sources/streams/concurrent/helpers.py,sha256=gtj9p0clZwgnClrIRH6V2Wl0Jwu11Plq-9FP4FU2VQA,1327
252
252
  airbyte_cdk/sources/streams/concurrent/partition_enqueuer.py,sha256=2t64b_z9cEPmlHZnjSiMTO8PEtEdiAJDG0JcYOtUqAE,3363
@@ -330,8 +330,8 @@ airbyte_cdk/utils/slice_hasher.py,sha256=-pHexlNYoWYPnXNH-M7HEbjmeJe9Zk7SJijdQ7d
330
330
  airbyte_cdk/utils/spec_schema_transformations.py,sha256=LVc9KbtMeV_z99jWo0Ou8u4l6eBJ0BWNhxj4zrrGKRs,763
331
331
  airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
332
332
  airbyte_cdk/utils/traced_exception.py,sha256=a6q51tBS3IdtefuOiL1eBwSmnNAXfjFMlMjSIQ_Tl-o,6165
333
- airbyte_cdk-6.7.1.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
334
- airbyte_cdk-6.7.1.dist-info/METADATA,sha256=_zN3B3AI1Fi9mkPxrvh9NPvcEQUKwLm9qMHavrSH_cE,13519
335
- airbyte_cdk-6.7.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
336
- airbyte_cdk-6.7.1.dist-info/entry_points.txt,sha256=fj-e3PAQvsxsQzyyq8UkG1k8spunWnD4BAH2AwlR6NM,95
337
- airbyte_cdk-6.7.1.dist-info/RECORD,,
333
+ airbyte_cdk-6.7.1.dev0.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
334
+ airbyte_cdk-6.7.1.dev0.dist-info/METADATA,sha256=SOty-zDaknlmVGpE7nzYCEZS0IxlbeL_NyCvLt5W-5k,13524
335
+ airbyte_cdk-6.7.1.dev0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
336
+ airbyte_cdk-6.7.1.dev0.dist-info/entry_points.txt,sha256=fj-e3PAQvsxsQzyyq8UkG1k8spunWnD4BAH2AwlR6NM,95
337
+ airbyte_cdk-6.7.1.dev0.dist-info/RECORD,,