airbyte-cdk 6.41.5__py3-none-any.whl → 6.41.6__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.
@@ -3,9 +3,11 @@
3
3
  import logging
4
4
  import threading
5
5
  import uuid
6
- from typing import Set
6
+ from dataclasses import dataclass, field
7
+ from typing import Any, Mapping, Set, Union
7
8
 
8
9
  from airbyte_cdk.logger import lazy_log
10
+ from airbyte_cdk.sources.declarative.interpolation import InterpolatedString
9
11
 
10
12
  LOGGER = logging.getLogger("airbyte")
11
13
 
@@ -14,15 +16,29 @@ class ConcurrentJobLimitReached(Exception):
14
16
  pass
15
17
 
16
18
 
19
+ @dataclass
17
20
  class JobTracker:
18
- def __init__(self, limit: int):
21
+ limit: Union[int, str]
22
+ config: Mapping[str, Any] = field(default_factory=dict)
23
+
24
+ def __post_init__(self) -> None:
19
25
  self._jobs: Set[str] = set()
20
- if limit < 1:
26
+ self._lock = threading.Lock()
27
+ if isinstance(self.limit, str):
28
+ try:
29
+ self.limit = int(
30
+ InterpolatedString(self.limit, parameters={}).eval(config=self.config)
31
+ )
32
+ except Exception as e:
33
+ LOGGER.warning(
34
+ f"Error interpolating max job count: {self.limit}. Setting to 1. {e}"
35
+ )
36
+ self.limit = 1
37
+ if self.limit < 1:
21
38
  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."
39
+ f"The `max_concurrent_async_job_count` property is less than 1: {self.limit}. Setting to 1. Please update the source manifest to set a valid value."
23
40
  )
24
- self._limit = 1 if limit < 1 else limit
25
- self._lock = threading.Lock()
41
+ self._limit = self.limit if self.limit >= 1 else 1
26
42
 
27
43
  def try_to_get_intent(self) -> str:
28
44
  lazy_log(
@@ -47,7 +47,12 @@ properties:
47
47
  max_concurrent_async_job_count:
48
48
  title: Maximum Concurrent Asynchronous Jobs
49
49
  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.
50
- type: integer
50
+ type:
51
+ - integer
52
+ - string
53
+ examples:
54
+ - 3
55
+ - "{{ config['max_concurrent_async_job_count'] }}"
51
56
  metadata:
52
57
  type: object
53
58
  description: For internal Airbyte use only - DO NOT modify manually. Used by consumers of declarative manifests for storing related metadata.
@@ -2192,7 +2197,8 @@ definitions:
2192
2197
  type: object
2193
2198
  additionalProperties: true
2194
2199
  JsonDecoder:
2195
- title: Json Decoder
2200
+ title: JSON
2201
+ description: Select 'JSON' if the response is formatted as a JSON object.
2196
2202
  type: object
2197
2203
  required:
2198
2204
  - type
@@ -2201,8 +2207,8 @@ definitions:
2201
2207
  type: string
2202
2208
  enum: [JsonDecoder]
2203
2209
  JsonlDecoder:
2204
- title: JSONL Decoder
2205
- description: Use this if the response consists of JSON objects separated by new lines (`\n`) in JSONL format.
2210
+ title: JSON Lines
2211
+ description: Select 'JSON Lines' if the response consists of JSON objects separated by new lines ('\n') in JSONL format.
2206
2212
  type: object
2207
2213
  required:
2208
2214
  - type
@@ -2327,8 +2333,8 @@ definitions:
2327
2333
  type: object
2328
2334
  additionalProperties: true
2329
2335
  IterableDecoder:
2330
- title: Iterable Decoder
2331
- description: Use this if the response consists of strings separated by new lines (`\n`). The Decoder will wrap each row into a JSON object with the `record` key.
2336
+ title: Iterable
2337
+ description: Select 'Iterable' if the response consists of strings separated by new lines (`\n`). The string will then be wrapped into a JSON object with the `record` key.
2332
2338
  type: object
2333
2339
  required:
2334
2340
  - type
@@ -2337,8 +2343,8 @@ definitions:
2337
2343
  type: string
2338
2344
  enum: [IterableDecoder]
2339
2345
  XmlDecoder:
2340
- title: XML Decoder
2341
- description: Use this if the response is XML.
2346
+ title: XML
2347
+ description: Select 'XML' if the response consists of XML-formatted data.
2342
2348
  type: object
2343
2349
  required:
2344
2350
  - type
@@ -2369,8 +2375,8 @@ definitions:
2369
2375
  type: object
2370
2376
  additionalProperties: true
2371
2377
  ZipfileDecoder:
2372
- title: Zipfile Decoder
2373
- description: Decoder for response data that is returned as zipfile(s).
2378
+ title: ZIP File
2379
+ description: Select 'ZIP file' for response data that is returned as a zipfile. Requires specifying an inner data type/decoder to parse the unzipped data.
2374
2380
  type: object
2375
2381
  additionalProperties: true
2376
2382
  required:
@@ -2894,7 +2900,7 @@ definitions:
2894
2900
  title: Lazy Read Pointer
2895
2901
  description: If set, this will enable lazy reading, using the initial read of parent records to extract child records.
2896
2902
  type: array
2897
- default: [ ]
2903
+ default: []
2898
2904
  items:
2899
2905
  - type: string
2900
2906
  interpolation_context:
@@ -3199,7 +3205,7 @@ definitions:
3199
3205
  properties:
3200
3206
  type:
3201
3207
  type: string
3202
- enum: [ StateDelegatingStream ]
3208
+ enum: [StateDelegatingStream]
3203
3209
  name:
3204
3210
  title: Name
3205
3211
  description: The stream name.
@@ -3276,6 +3282,8 @@ definitions:
3276
3282
  type: object
3277
3283
  additionalProperties: true
3278
3284
  GzipDecoder:
3285
+ title: gzip
3286
+ description: Select 'gzip' for response data that is compressed with gzip. Requires specifying an inner data type/decoder to parse the decompressed data.
3279
3287
  type: object
3280
3288
  required:
3281
3289
  - type
@@ -3291,6 +3299,8 @@ definitions:
3291
3299
  - "$ref": "#/definitions/JsonDecoder"
3292
3300
  - "$ref": "#/definitions/JsonlDecoder"
3293
3301
  CsvDecoder:
3302
+ title: CSV
3303
+ description: "Select 'CSV' for response data that is formatted as CSV (comma-separated values). Can specify an encoding (default: 'utf-8') and a delimiter (default: ',')."
3294
3304
  type: object
3295
3305
  required:
3296
3306
  - type
@@ -1890,9 +1890,10 @@ class DeclarativeSource1(BaseModel):
1890
1890
  spec: Optional[Spec] = None
1891
1891
  concurrency_level: Optional[ConcurrencyLevel] = None
1892
1892
  api_budget: Optional[HTTPAPIBudget] = None
1893
- max_concurrent_async_job_count: Optional[int] = Field(
1893
+ max_concurrent_async_job_count: Optional[Union[int, str]] = Field(
1894
1894
  None,
1895
1895
  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.",
1896
+ examples=[3, "{{ config['max_concurrent_async_job_count'] }}"],
1896
1897
  title="Maximum Concurrent Asynchronous Jobs",
1897
1898
  )
1898
1899
  metadata: Optional[Dict[str, Any]] = Field(
@@ -1922,9 +1923,10 @@ class DeclarativeSource2(BaseModel):
1922
1923
  spec: Optional[Spec] = None
1923
1924
  concurrency_level: Optional[ConcurrencyLevel] = None
1924
1925
  api_budget: Optional[HTTPAPIBudget] = None
1925
- max_concurrent_async_job_count: Optional[int] = Field(
1926
+ max_concurrent_async_job_count: Optional[Union[int, str]] = Field(
1926
1927
  None,
1927
1928
  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.",
1929
+ examples=[3, "{{ config['max_concurrent_async_job_count'] }}"],
1928
1930
  title="Maximum Concurrent Asynchronous Jobs",
1929
1931
  )
1930
1932
  metadata: Optional[Dict[str, Any]] = Field(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 6.41.5
3
+ Version: 6.41.6
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=aR5UZAkNUYA1I1zjUMAcvdzCFL3lXXOllkFmlhEKgkc,2001
52
52
  airbyte_cdk/sources/declarative/async_job/job_orchestrator.py,sha256=tcHvB5QdBnx4XQmFvr4Swdq2DLRPst5w5M-OIJHnp5c,22034
53
- airbyte_cdk/sources/declarative/async_job/job_tracker.py,sha256=oAaqKxj5dGKeF5wkqiOZbu5gW6JvtaROxirDU2KqT1o,2565
53
+ airbyte_cdk/sources/declarative/async_job/job_tracker.py,sha256=JowKzdT4E6IeE1cYIf4mOtB6sVEJoCeSsfzaFi9ghQ8,3231
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=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=dROHv50GZ7rGn7u2KrQSaAg5MjRZj1dNc-7VrZMIUb0,150439
74
+ airbyte_cdk/sources/declarative/declarative_component_schema.yaml,sha256=7yP2RxR6a0atvRiqB52J5k0kWlX-O6XEWdrCVFt1sCU,151082
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,7 +114,7 @@ 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=0vCjpAXGkkgocHrgUUVzSCzcCKfXQMr-u0I1U-mVczQ,106717
117
+ airbyte_cdk/sources/declarative/models/declarative_component_schema.py,sha256=p0-xyRzsPBfTpJy1B8I87J0dIyWVRu9y2v9McSkY6Js,106885
118
118
  airbyte_cdk/sources/declarative/parsers/__init__.py,sha256=ZnqYNxHsKCgO38IwB34RQyRMXTs4GTvlRi3ImKnIioo,61
119
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
@@ -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.5.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
362
- airbyte_cdk-6.41.5.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
363
- airbyte_cdk-6.41.5.dist-info/METADATA,sha256=lU55s01kRtTNVELjzwH0ZFZcKc9mDaAoegbKH5sRuAs,6071
364
- airbyte_cdk-6.41.5.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
365
- airbyte_cdk-6.41.5.dist-info/entry_points.txt,sha256=fj-e3PAQvsxsQzyyq8UkG1k8spunWnD4BAH2AwlR6NM,95
366
- airbyte_cdk-6.41.5.dist-info/RECORD,,
361
+ airbyte_cdk-6.41.6.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
362
+ airbyte_cdk-6.41.6.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
363
+ airbyte_cdk-6.41.6.dist-info/METADATA,sha256=Xk23ce8RxVdxAlwvLwJpDyXn1pYHJPNhRpL0W98ChZw,6071
364
+ airbyte_cdk-6.41.6.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
365
+ airbyte_cdk-6.41.6.dist-info/entry_points.txt,sha256=fj-e3PAQvsxsQzyyq8UkG1k8spunWnD4BAH2AwlR6NM,95
366
+ airbyte_cdk-6.41.6.dist-info/RECORD,,