airbyte-cdk 6.41.0__py3-none-any.whl → 6.41.2__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.
@@ -3333,7 +3333,7 @@ definitions:
3333
3333
  items:
3334
3334
  type: string
3335
3335
  AsyncRetriever:
3336
- description: "[Experimental - We expect the interface to change shortly and we reserve the right to not consider this a breaking change] Retrieves records by Asynchronously sending requests to fetch records. The retriever acts as an orchestrator between the requester, the record selector, the paginator, and the partition router."
3336
+ description: "Retrieves records by Asynchronously sending requests to fetch records. The retriever acts as an orchestrator between the requester, the record selector, the paginator, and the partition router."
3337
3337
  type: object
3338
3338
  required:
3339
3339
  - type
@@ -3381,6 +3381,13 @@ definitions:
3381
3381
  anyOf:
3382
3382
  - "$ref": "#/definitions/CustomRequester"
3383
3383
  - "$ref": "#/definitions/HttpRequester"
3384
+ polling_job_timeout:
3385
+ description: The time in minutes after which the single Async Job should be considered as Timed Out.
3386
+ anyOf:
3387
+ - type: integer
3388
+ - type: string
3389
+ interpolation_context:
3390
+ - config
3384
3391
  download_target_requester:
3385
3392
  description: Requester component that describes how to prepare HTTP requests to send to the source API to extract the url from polling response by the completed async job.
3386
3393
  anyOf:
@@ -1467,7 +1467,7 @@ class AddFields(BaseModel):
1467
1467
  )
1468
1468
  condition: Optional[str] = Field(
1469
1469
  "",
1470
- description="Fields will be added if expression is evaluated to True.,",
1470
+ description="Fields will be added if expression is evaluated to True.",
1471
1471
  examples=[
1472
1472
  "{{ property|string == '' }}",
1473
1473
  "{{ property is integer }}",
@@ -2354,6 +2354,10 @@ class AsyncRetriever(BaseModel):
2354
2354
  ...,
2355
2355
  description="Requester component that describes how to prepare HTTP requests to send to the source API to fetch the status of the running async job.",
2356
2356
  )
2357
+ polling_job_timeout: Optional[Union[int, str]] = Field(
2358
+ None,
2359
+ description="The time in minutes after which the single Async Job should be considered as Timed Out.",
2360
+ )
2357
2361
  download_target_requester: Optional[Union[CustomRequester, HttpRequester]] = Field(
2358
2362
  None,
2359
2363
  description="Requester component that describes how to prepare HTTP requests to send to the source API to extract the url from polling response by the completed async job.",
@@ -19,7 +19,7 @@ SDM_COMPONENTS_MODULE_NAME = "source_declarative_manifest.components"
19
19
  INJECTED_MANIFEST = "__injected_declarative_manifest"
20
20
  INJECTED_COMPONENTS_PY = "__injected_components_py"
21
21
  INJECTED_COMPONENTS_PY_CHECKSUMS = "__injected_components_py_checksums"
22
- ENV_VAR_ALLOW_CUSTOM_CODE = "AIRBYTE_ALLOW_CUSTOM_CODE"
22
+ ENV_VAR_ALLOW_CUSTOM_CODE = "AIRBYTE_ENABLE_UNSAFE_CODE"
23
23
 
24
24
 
25
25
  class AirbyteCodeTamperedError(Exception):
@@ -35,7 +35,7 @@ class AirbyteCustomCodeNotPermittedError(Exception):
35
35
  def __init__(self) -> None:
36
36
  super().__init__(
37
37
  "Custom connector code is not permitted in this environment. "
38
- "If you need to run custom code, please ask your administrator to set the `AIRBYTE_ALLOW_CUSTOM_CODE` "
38
+ "If you need to run custom code, please ask your administrator to set the `AIRBYTE_ENABLE_UNSAFE_CODE` "
39
39
  "environment variable to 'true' in your Airbyte environment. "
40
40
  "If you see this message in Airbyte Cloud, your workspace does not allow executing "
41
41
  "custom connector code."
@@ -55,7 +55,7 @@ def _hash_text(input_text: str, hash_type: str = "md5") -> str:
55
55
  def custom_code_execution_permitted() -> bool:
56
56
  """Return `True` if custom code execution is permitted, otherwise `False`.
57
57
 
58
- Custom code execution is permitted if the `AIRBYTE_ALLOW_CUSTOM_CODE` environment variable is set to 'true'.
58
+ Custom code execution is permitted if the `AIRBYTE_ENABLE_UNSAFE_CODE` environment variable is set to 'true'.
59
59
  """
60
60
  return os.environ.get(ENV_VAR_ALLOW_CUSTOM_CODE, "").lower() == "true"
61
61
 
@@ -507,7 +507,7 @@ from airbyte_cdk.sources.streams.concurrent.state_converters.incrementing_count_
507
507
  IncrementingCountStreamStateConverter,
508
508
  )
509
509
  from airbyte_cdk.sources.streams.http.error_handlers.response_models import ResponseAction
510
- from airbyte_cdk.sources.types import Config, ConnectionDefinition
510
+ from airbyte_cdk.sources.types import Config
511
511
  from airbyte_cdk.sources.utils.transform import TransformConfig, TypeTransformer
512
512
 
513
513
  ComponentDefinition = Mapping[str, Any]
@@ -2939,6 +2939,27 @@ class ModelToComponentFactory:
2939
2939
  parameters={},
2940
2940
  )
2941
2941
 
2942
+ def _get_job_timeout() -> datetime.timedelta:
2943
+ user_defined_timeout: Optional[int] = (
2944
+ int(
2945
+ InterpolatedString.create(
2946
+ str(model.polling_job_timeout),
2947
+ parameters={},
2948
+ ).eval(config)
2949
+ )
2950
+ if model.polling_job_timeout
2951
+ else None
2952
+ )
2953
+
2954
+ # check for user defined timeout during the test read or 15 minutes
2955
+ test_read_timeout = datetime.timedelta(minutes=user_defined_timeout or 15)
2956
+ # default value for non-connector builder is 60 minutes.
2957
+ default_sync_timeout = datetime.timedelta(minutes=user_defined_timeout or 60)
2958
+
2959
+ return (
2960
+ test_read_timeout if self._emit_connector_builder_messages else default_sync_timeout
2961
+ )
2962
+
2942
2963
  decoder = (
2943
2964
  self._create_component_from_model(model=model.decoder, config=config)
2944
2965
  if model.decoder
@@ -3032,6 +3053,7 @@ class ModelToComponentFactory:
3032
3053
  config=config,
3033
3054
  name=name,
3034
3055
  )
3056
+
3035
3057
  job_repository: AsyncJobRepository = AsyncHttpJobRepository(
3036
3058
  creation_requester=creation_requester,
3037
3059
  polling_requester=polling_requester,
@@ -3042,6 +3064,7 @@ class ModelToComponentFactory:
3042
3064
  status_extractor=status_extractor,
3043
3065
  status_mapping=self._create_async_job_status_mapping(model.status_mapping, config),
3044
3066
  download_target_extractor=download_target_extractor,
3067
+ job_timeout=_get_job_timeout(),
3045
3068
  )
3046
3069
 
3047
3070
  async_job_partition_router = AsyncJobPartitionRouter(
@@ -45,7 +45,9 @@ class AsyncHttpJobRepository(AsyncJobRepository):
45
45
  status_mapping: Mapping[str, AsyncJobStatus]
46
46
  download_target_extractor: DpathExtractor
47
47
 
48
+ # timeout for the job to be completed, passed from `polling_job_timeout`
48
49
  job_timeout: Optional[timedelta] = None
50
+
49
51
  record_extractor: RecordExtractor = field(
50
52
  init=False, repr=False, default_factory=lambda: ResponseToFileExtractor({})
51
53
  )
@@ -131,7 +133,7 @@ class AsyncHttpJobRepository(AsyncJobRepository):
131
133
  log_formatter=lambda response: format_http_message(
132
134
  response=response,
133
135
  title="Async Job -- Create",
134
- description="Create the server-side async job.",
136
+ description=f"Create the server-side async job. Timeout after: {self.job_timeout}",
135
137
  stream_name=None,
136
138
  is_auxiliary=True,
137
139
  type="ASYNC_CREATE",
@@ -4,24 +4,17 @@
4
4
  from dataclasses import InitVar, dataclass, field
5
5
  from typing import Any, Iterable, Mapping, Optional
6
6
 
7
- from typing_extensions import deprecated
8
-
9
7
  from airbyte_cdk.sources.declarative.async_job.job import AsyncJob
10
8
  from airbyte_cdk.sources.declarative.extractors.record_selector import RecordSelector
11
9
  from airbyte_cdk.sources.declarative.partition_routers.async_job_partition_router import (
12
10
  AsyncJobPartitionRouter,
13
11
  )
14
12
  from airbyte_cdk.sources.declarative.retrievers.retriever import Retriever
15
- from airbyte_cdk.sources.source import ExperimentalClassWarning
16
13
  from airbyte_cdk.sources.streams.core import StreamData
17
14
  from airbyte_cdk.sources.types import Config, StreamSlice, StreamState
18
15
  from airbyte_cdk.sources.utils.slice_logger import AlwaysLogSliceLogger
19
16
 
20
17
 
21
- @deprecated(
22
- "This class is experimental. Use at your own risk.",
23
- category=ExperimentalClassWarning,
24
- )
25
18
  @dataclass
26
19
  class AsyncRetriever(Retriever):
27
20
  config: Config
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 6.41.0
3
+ Version: 6.41.2
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -71,7 +71,7 @@ airbyte_cdk/sources/declarative/concurrent_declarative_source.py,sha256=uhy0dRkA
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=5lAt9rGpiUElT16jybLALS3DMkyLrz7JNUeyv2nv5c0,150310
74
+ airbyte_cdk/sources/declarative/declarative_component_schema.yaml,sha256=dROHv50GZ7rGn7u2KrQSaAg5MjRZj1dNc-7VrZMIUb0,150439
75
75
  airbyte_cdk/sources/declarative/declarative_source.py,sha256=nF7wBqFd3AQmEKAm4CnIo29CJoQL562cJGSCeL8U8bA,1531
76
76
  airbyte_cdk/sources/declarative/declarative_stream.py,sha256=dCRlddBUSaJmBNBz1pSO1r2rTw8AP5d2_vlmIeGs2gg,10767
77
77
  airbyte_cdk/sources/declarative/decoders/__init__.py,sha256=JHb_0d3SE6kNY10mxA5YBEKPeSbsWYjByq1gUQxepoE,953
@@ -114,13 +114,13 @@ airbyte_cdk/sources/declarative/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW
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=uO-NMBY90yb8Kg_SdGTsXgerUKAKBM6rsWovXbvPclI,106527
117
+ airbyte_cdk/sources/declarative/models/declarative_component_schema.py,sha256=0vCjpAXGkkgocHrgUUVzSCzcCKfXQMr-u0I1U-mVczQ,106717
118
118
  airbyte_cdk/sources/declarative/parsers/__init__.py,sha256=ZnqYNxHsKCgO38IwB34RQyRMXTs4GTvlRi3ImKnIioo,61
119
- airbyte_cdk/sources/declarative/parsers/custom_code_compiler.py,sha256=jDw_TttD3_hpfevXOH-0Ws0eRuqt6wvED0BqosGPRjI,5938
119
+ airbyte_cdk/sources/declarative/parsers/custom_code_compiler.py,sha256=nlVvHC511NUyDEEIRBkoeDTAvLqKNp-hRy8D19z8tdk,5941
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=bKo2WsTSNAQkTtcjVSXniwjgLNYaD3Lx_9vM02rakYU,146478
123
+ airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=Rkz5ae83PyjioQg6rcSZwLbR1s4rOte_KwXfNTP2BbM,147373
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
@@ -143,7 +143,7 @@ airbyte_cdk/sources/declarative/requesters/error_handlers/default_error_handler.
143
143
  airbyte_cdk/sources/declarative/requesters/error_handlers/default_http_response_filter.py,sha256=q0YkeYUUWO6iErUy0vjqiOkhg8_9d5YcCmtlpXAJJ9E,1314
144
144
  airbyte_cdk/sources/declarative/requesters/error_handlers/error_handler.py,sha256=Tan66odx8VHzfdyyXMQkXz2pJYksllGqvxmpoajgcK4,669
145
145
  airbyte_cdk/sources/declarative/requesters/error_handlers/http_response_filter.py,sha256=E-fQbt4ShfxZVoqfnmOx69C6FUPWZz8BIqI3DN9Kcjs,7935
146
- airbyte_cdk/sources/declarative/requesters/http_job_repository.py,sha256=4wpP0ZNTMLugi-Rc1OFdFaxWfRZSl45nzhHqMFCE8SQ,11924
146
+ airbyte_cdk/sources/declarative/requesters/http_job_repository.py,sha256=4egnsWqzOhizHEvxhs43eAJazT211FtUmPHOr-8SsMQ,12037
147
147
  airbyte_cdk/sources/declarative/requesters/http_requester.py,sha256=uEhUmLGVuwfadKz0c1vunrr66ZNYWmotKZWiaPYPDzw,17402
148
148
  airbyte_cdk/sources/declarative/requesters/paginators/__init__.py,sha256=uArbKs9JKNCt7t9tZoeWwjDpyI1HoPp29FNW0JzvaEM,644
149
149
  airbyte_cdk/sources/declarative/requesters/paginators/default_paginator.py,sha256=SB-Af3CRb4mJwhm4EKNxzl_PK2w5QS4tqrSNNMO2IV4,12760
@@ -170,7 +170,7 @@ airbyte_cdk/sources/declarative/resolvers/components_resolver.py,sha256=KPjKc0yb
170
170
  airbyte_cdk/sources/declarative/resolvers/config_components_resolver.py,sha256=dz4iJV9liD_LzY_Mn4XmAStoUll60R3MIGWV4aN3pgg,5223
171
171
  airbyte_cdk/sources/declarative/resolvers/http_components_resolver.py,sha256=AiojNs8wItJFrENZBFUaDvau3sgwudO6Wkra36upSPo,4639
172
172
  airbyte_cdk/sources/declarative/retrievers/__init__.py,sha256=nQepwG_RfW53sgwvK5dLPqfCx0VjsQ83nYoPjBMAaLM,527
173
- airbyte_cdk/sources/declarative/retrievers/async_retriever.py,sha256=Fxwg53i_9R3kMNFtD3gEwZbdW8xlcXYXA5evEhrKunM,5072
173
+ airbyte_cdk/sources/declarative/retrievers/async_retriever.py,sha256=6oZtnCHm9NdDvjTSrVwPQOXGSdETSIR7eWH2vFjM7jI,4855
174
174
  airbyte_cdk/sources/declarative/retrievers/retriever.py,sha256=XPLs593Xv8c5cKMc37XzUAYmzlXd1a7eSsspM-CMuWA,1696
175
175
  airbyte_cdk/sources/declarative/retrievers/simple_retriever.py,sha256=p6O4FYS7zzPq6uQT2NVnughUjI66tePaXVlyhCAyyv0,27746
176
176
  airbyte_cdk/sources/declarative/schema/__init__.py,sha256=xU45UvM5O4c1PSM13UHpCdh5hpW3HXy9vRRGEiAC1rg,795
@@ -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.41.0.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
362
- airbyte_cdk-6.41.0.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
363
- airbyte_cdk-6.41.0.dist-info/METADATA,sha256=j_-dbmwZXO1MF14gKQRHWyxKUSR6z_E8pDCJTAnWkZs,6071
364
- airbyte_cdk-6.41.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
365
- airbyte_cdk-6.41.0.dist-info/entry_points.txt,sha256=fj-e3PAQvsxsQzyyq8UkG1k8spunWnD4BAH2AwlR6NM,95
366
- airbyte_cdk-6.41.0.dist-info/RECORD,,
361
+ airbyte_cdk-6.41.2.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
362
+ airbyte_cdk-6.41.2.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
363
+ airbyte_cdk-6.41.2.dist-info/METADATA,sha256=9Ouq9vugM669lqFm4ZeuMIhZDfgFWTTkRkOWNxvQ_Aw,6071
364
+ airbyte_cdk-6.41.2.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
365
+ airbyte_cdk-6.41.2.dist-info/entry_points.txt,sha256=fj-e3PAQvsxsQzyyq8UkG1k8spunWnD4BAH2AwlR6NM,95
366
+ airbyte_cdk-6.41.2.dist-info/RECORD,,