airbyte-cdk 6.38.5__py3-none-any.whl → 6.39.0__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.
@@ -17,7 +17,11 @@ class ConcurrentJobLimitReached(Exception):
17
17
  class JobTracker:
18
18
  def __init__(self, limit: int):
19
19
  self._jobs: Set[str] = set()
20
- self._limit = limit
20
+ if limit < 1:
21
+ LOGGER.warning(
22
+ f"The `max_concurrent_async_job_count` property is less than 1: {limit}. Setting to 1. Please update the source manifest to set a valid value."
23
+ )
24
+ self._limit = 1 if limit < 1 else limit
21
25
  self._lock = threading.Lock()
22
26
 
23
27
  def try_to_get_intent(self) -> str:
@@ -42,6 +42,10 @@ properties:
42
42
  "$ref": "#/definitions/ConcurrencyLevel"
43
43
  api_budget:
44
44
  "$ref": "#/definitions/HTTPAPIBudget"
45
+ max_concurrent_async_job_count:
46
+ title: Maximum Concurrent Asynchronous Jobs
47
+ description: Maximum number of concurrent asynchronous jobs to run. This property is only relevant for sources/streams that support asynchronous job execution through the AsyncRetriever (e.g. a report-based stream that initiates a job, polls the job status, and then fetches the job results). This is often set by the API's maximum number of concurrent jobs on the account level. Refer to the API's documentation for this information.
48
+ type: integer
45
49
  metadata:
46
50
  type: object
47
51
  description: For internal Airbyte use only - DO NOT modify manually. Used by consumers of declarative manifests for storing related metadata.
@@ -93,7 +93,10 @@ class ManifestDeclarativeSource(DeclarativeSource):
93
93
  self._constructor = (
94
94
  component_factory
95
95
  if component_factory
96
- else ModelToComponentFactory(emit_connector_builder_messages)
96
+ else ModelToComponentFactory(
97
+ emit_connector_builder_messages,
98
+ max_concurrent_async_job_count=source_config.get("max_concurrent_async_job_count"),
99
+ )
97
100
  )
98
101
  self._message_repository = self._constructor.get_message_repository()
99
102
  self._slice_logger: SliceLogger = (
@@ -1871,6 +1871,11 @@ class DeclarativeSource1(BaseModel):
1871
1871
  spec: Optional[Spec] = None
1872
1872
  concurrency_level: Optional[ConcurrencyLevel] = None
1873
1873
  api_budget: Optional[HTTPAPIBudget] = None
1874
+ max_concurrent_async_job_count: Optional[int] = Field(
1875
+ None,
1876
+ description="Maximum number of concurrent asynchronous jobs to run. This property is only relevant for sources/streams that support asynchronous job execution through the AsyncRetriever (e.g. a report-based stream that initiates a job, polls the job status, and then fetches the job results). This is often set by the API's maximum number of concurrent jobs on the account level. Refer to the API's documentation for this information.",
1877
+ title="Maximum Concurrent Asynchronous Jobs",
1878
+ )
1874
1879
  metadata: Optional[Dict[str, Any]] = Field(
1875
1880
  None,
1876
1881
  description="For internal Airbyte use only - DO NOT modify manually. Used by consumers of declarative manifests for storing related metadata.",
@@ -1898,6 +1903,11 @@ class DeclarativeSource2(BaseModel):
1898
1903
  spec: Optional[Spec] = None
1899
1904
  concurrency_level: Optional[ConcurrencyLevel] = None
1900
1905
  api_budget: Optional[HTTPAPIBudget] = None
1906
+ max_concurrent_async_job_count: Optional[int] = Field(
1907
+ None,
1908
+ description="Maximum number of concurrent asynchronous jobs to run. This property is only relevant for sources/streams that support asynchronous job execution through the AsyncRetriever (e.g. a report-based stream that initiates a job, polls the job status, and then fetches the job results). This is often set by the API's maximum number of concurrent jobs on the account level. Refer to the API's documentation for this information.",
1909
+ title="Maximum Concurrent Asynchronous Jobs",
1910
+ )
1901
1911
  metadata: Optional[Dict[str, Any]] = Field(
1902
1912
  None,
1903
1913
  description="For internal Airbyte use only - DO NOT modify manually. Used by consumers of declarative manifests for storing related metadata.",
@@ -503,7 +503,7 @@ from airbyte_cdk.sources.streams.concurrent.state_converters.incrementing_count_
503
503
  IncrementingCountStreamStateConverter,
504
504
  )
505
505
  from airbyte_cdk.sources.streams.http.error_handlers.response_models import ResponseAction
506
- from airbyte_cdk.sources.types import Config
506
+ from airbyte_cdk.sources.types import Config, ConnectionDefinition
507
507
  from airbyte_cdk.sources.utils.transform import TransformConfig, TypeTransformer
508
508
 
509
509
  ComponentDefinition = Mapping[str, Any]
@@ -527,6 +527,7 @@ class ModelToComponentFactory:
527
527
  disable_resumable_full_refresh: bool = False,
528
528
  message_repository: Optional[MessageRepository] = None,
529
529
  connector_state_manager: Optional[ConnectorStateManager] = None,
530
+ max_concurrent_async_job_count: Optional[int] = None,
530
531
  ):
531
532
  self._init_mappings()
532
533
  self._limit_pages_fetched_per_slice = limit_pages_fetched_per_slice
@@ -540,6 +541,7 @@ class ModelToComponentFactory:
540
541
  )
541
542
  self._connector_state_manager = connector_state_manager or ConnectorStateManager()
542
543
  self._api_budget: Optional[Union[APIBudget, HttpAPIBudget]] = None
544
+ self._job_tracker: JobTracker = JobTracker(max_concurrent_async_job_count or 1)
543
545
 
544
546
  def _init_mappings(self) -> None:
545
547
  self.PYDANTIC_MODEL_TO_CONSTRUCTOR: Mapping[Type[BaseModel], Callable[..., Any]] = {
@@ -2928,8 +2930,7 @@ class ModelToComponentFactory:
2928
2930
  job_orchestrator_factory=lambda stream_slices: AsyncJobOrchestrator(
2929
2931
  job_repository,
2930
2932
  stream_slices,
2931
- JobTracker(1),
2932
- # FIXME eventually make the number of concurrent jobs in the API configurable. Until then, we limit to 1
2933
+ self._job_tracker,
2933
2934
  self._message_repository,
2934
2935
  has_bulk_parent=False,
2935
2936
  # FIXME work would need to be done here in order to detect if a stream as a parent stream that is bulk
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 6.38.5
3
+ Version: 6.39.0
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -50,7 +50,7 @@ airbyte_cdk/sources/declarative/__init__.py,sha256=ZnqYNxHsKCgO38IwB34RQyRMXTs4G
50
50
  airbyte_cdk/sources/declarative/async_job/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
51
  airbyte_cdk/sources/declarative/async_job/job.py,sha256=V4Z6NohXwTlOavDbD-tUUQxOr7Lzpb_r4tRC64AfvDE,1702
52
52
  airbyte_cdk/sources/declarative/async_job/job_orchestrator.py,sha256=nUimSsq1nbEe3UPqsVC9mj8Zh2GYptJUZHQSVTbpWIc,21026
53
- airbyte_cdk/sources/declarative/async_job/job_tracker.py,sha256=SQt21SftVgP7RUCQ8LA2vaCn-YEbyX1BnhibfTX9oaE,2321
53
+ airbyte_cdk/sources/declarative/async_job/job_tracker.py,sha256=oAaqKxj5dGKeF5wkqiOZbu5gW6JvtaROxirDU2KqT1o,2565
54
54
  airbyte_cdk/sources/declarative/async_job/repository.py,sha256=2OkWiZp5IKTOi_SIpP1U-Rw3gH36LBy_a8CgXoENTtg,1044
55
55
  airbyte_cdk/sources/declarative/async_job/status.py,sha256=mkExR-uOAO1ckUnclaUOa74l2N9CdhLbVFM6KDoBgBM,715
56
56
  airbyte_cdk/sources/declarative/async_job/timer.py,sha256=Fb8P72CQ7jIzJyzMSSNuBf2vt8bmrg9SrfmNxKwph2A,1242
@@ -71,7 +71,7 @@ airbyte_cdk/sources/declarative/concurrent_declarative_source.py,sha256=rAp-sgld
71
71
  airbyte_cdk/sources/declarative/datetime/__init__.py,sha256=4Hw-PX1-VgESLF16cDdvuYCzGJtHntThLF4qIiULWeo,61
72
72
  airbyte_cdk/sources/declarative/datetime/datetime_parser.py,sha256=_zGNGq31RNy_0QBLt_EcTvgPyhj7urPdx6oA3M5-r3o,3150
73
73
  airbyte_cdk/sources/declarative/datetime/min_max_datetime.py,sha256=0BHBtDNQZfvwM45-tY5pNlTcKAFSGGNxemoi0Jic-0E,5785
74
- airbyte_cdk/sources/declarative/declarative_component_schema.yaml,sha256=WEpQZGl784f6hjakiWV6YC-ckJrtvpG2XpWixLXG3tg,147469
74
+ airbyte_cdk/sources/declarative/declarative_component_schema.yaml,sha256=2kFMQC2TpM_dmNJe0vYtez5XzdFy4nnWo1WowqKG1pA,148008
75
75
  airbyte_cdk/sources/declarative/declarative_source.py,sha256=nF7wBqFd3AQmEKAm4CnIo29CJoQL562cJGSCeL8U8bA,1531
76
76
  airbyte_cdk/sources/declarative/declarative_stream.py,sha256=venZjfpvtqr3oFSuvMBWtn4h9ayLhD4L65ACuXCDZ64,10445
77
77
  airbyte_cdk/sources/declarative/decoders/__init__.py,sha256=JHb_0d3SE6kNY10mxA5YBEKPeSbsWYjByq1gUQxepoE,953
@@ -109,18 +109,18 @@ airbyte_cdk/sources/declarative/interpolation/interpolated_string.py,sha256=CQkH
109
109
  airbyte_cdk/sources/declarative/interpolation/interpolation.py,sha256=9IoeuWam3L6GyN10L6U8xNWXmkt9cnahSDNkez1OmFY,982
110
110
  airbyte_cdk/sources/declarative/interpolation/jinja.py,sha256=UQeuS4Vpyp4hlOn-R3tRyeBX0e9IoV6jQ6gH-Jz8lY0,7182
111
111
  airbyte_cdk/sources/declarative/interpolation/macros.py,sha256=HQKHKnjE17zKoPn27ZpTpugRZZQSaof4GVzUUZaV2eE,5081
112
- airbyte_cdk/sources/declarative/manifest_declarative_source.py,sha256=TN6GCgLXaWDONTaJwQ3A5ELqC-sxwKz-UYSraJYB-dI,17078
112
+ airbyte_cdk/sources/declarative/manifest_declarative_source.py,sha256=DJuLm_5iG66cyD16mRWG_rwmgNIORWSkFLxstC93Tc8,17209
113
113
  airbyte_cdk/sources/declarative/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
114
114
  airbyte_cdk/sources/declarative/migrations/legacy_to_per_partition_state_migration.py,sha256=iemy3fKLczcU0-Aor7tx5jcT6DRedKMqyK7kCOp01hg,3924
115
115
  airbyte_cdk/sources/declarative/migrations/state_migration.py,sha256=KWPjealMLKSMtajXgkdGgKg7EmTLR-CqqD7UIh0-eDU,794
116
116
  airbyte_cdk/sources/declarative/models/__init__.py,sha256=nUFxNCiKeYRVXuZEKA7GD-lTHxsiKcQ8FitZjKhPIvE,100
117
- airbyte_cdk/sources/declarative/models/declarative_component_schema.py,sha256=DfbPi512ovaBSWDICJfjIkC3pXDn2aNr1BP-eiLOLyA,103556
117
+ airbyte_cdk/sources/declarative/models/declarative_component_schema.py,sha256=IbSrniMEvDhmiXtArtBpC2ie5pIC0tHh1JKnBSe3EcM,104712
118
118
  airbyte_cdk/sources/declarative/parsers/__init__.py,sha256=ZnqYNxHsKCgO38IwB34RQyRMXTs4GTvlRi3ImKnIioo,61
119
119
  airbyte_cdk/sources/declarative/parsers/custom_code_compiler.py,sha256=jDw_TttD3_hpfevXOH-0Ws0eRuqt6wvED0BqosGPRjI,5938
120
120
  airbyte_cdk/sources/declarative/parsers/custom_exceptions.py,sha256=Rir9_z3Kcd5Es0-LChrzk-0qubAsiK_RSEnLmK2OXm8,553
121
121
  airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py,sha256=CXwTfD3wSQq3okcqwigpprbHhSURUokh4GK2OmOyKC8,9132
122
122
  airbyte_cdk/sources/declarative/parsers/manifest_reference_resolver.py,sha256=IWUOdF03o-aQn0Occo1BJCxU0Pz-QILk5L67nzw2thw,6803
123
- airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=4FEIBgkAn85qmOEjmi8rRPBERdktNpOFjXGbw0Fsau8,142441
123
+ airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=2VkO2gqw4j8sqmuIB-4JKhle4NJrFJy586M9YPatDc0,142496
124
124
  airbyte_cdk/sources/declarative/partition_routers/__init__.py,sha256=HJ-Syp3p7RpyR_OK0X_a2kSyISfu3W-PKrRI16iY0a8,957
125
125
  airbyte_cdk/sources/declarative/partition_routers/async_job_partition_router.py,sha256=VelO7zKqKtzMJ35jyFeg0ypJLQC0plqqIBNXoBW1G2E,3001
126
126
  airbyte_cdk/sources/declarative/partition_routers/cartesian_product_stream_slicer.py,sha256=c5cuVFM6NFkuQqG8Z5IwkBuwDrvXZN1CunUOM_L0ezg,6892
@@ -358,9 +358,9 @@ airbyte_cdk/utils/slice_hasher.py,sha256=EDxgROHDbfG-QKQb59m7h_7crN1tRiawdf5uU7G
358
358
  airbyte_cdk/utils/spec_schema_transformations.py,sha256=-5HTuNsnDBAhj-oLeQXwpTGA0HdcjFOf2zTEMUTTg_Y,816
359
359
  airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
360
360
  airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
361
- airbyte_cdk-6.38.5.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
362
- airbyte_cdk-6.38.5.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
363
- airbyte_cdk-6.38.5.dist-info/METADATA,sha256=G-czc95JpGgXr9wO1X3apOpeq1Q6jIyZQ9L-tRllR5Y,6013
364
- airbyte_cdk-6.38.5.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
365
- airbyte_cdk-6.38.5.dist-info/entry_points.txt,sha256=fj-e3PAQvsxsQzyyq8UkG1k8spunWnD4BAH2AwlR6NM,95
366
- airbyte_cdk-6.38.5.dist-info/RECORD,,
361
+ airbyte_cdk-6.39.0.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
362
+ airbyte_cdk-6.39.0.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
363
+ airbyte_cdk-6.39.0.dist-info/METADATA,sha256=7zM8BE2_CcIFxmvyC_TVNF7Dy9tvKFOnjnlOzCwpc40,6013
364
+ airbyte_cdk-6.39.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
365
+ airbyte_cdk-6.39.0.dist-info/entry_points.txt,sha256=fj-e3PAQvsxsQzyyq8UkG1k8spunWnD4BAH2AwlR6NM,95
366
+ airbyte_cdk-6.39.0.dist-info/RECORD,,