airbyte-cdk 6.33.2.dev0__py3-none-any.whl → 6.33.3__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.
- airbyte_cdk/sources/declarative/auth/oauth.py +6 -1
- airbyte_cdk/sources/declarative/concurrent_declarative_source.py +15 -1
- airbyte_cdk/sources/declarative/declarative_component_schema.yaml +23 -288
- airbyte_cdk/sources/declarative/decoders/__init__.py +0 -4
- airbyte_cdk/sources/declarative/decoders/composite_raw_decoder.py +7 -2
- airbyte_cdk/sources/declarative/decoders/json_decoder.py +12 -58
- airbyte_cdk/sources/declarative/incremental/concurrent_partition_cursor.py +6 -11
- airbyte_cdk/sources/declarative/manifest_declarative_source.py +0 -4
- airbyte_cdk/sources/declarative/models/declarative_component_schema.py +14 -202
- airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py +53 -196
- airbyte_cdk/sources/declarative/requesters/http_requester.py +0 -3
- airbyte_cdk/sources/streams/call_rate.py +40 -116
- airbyte_cdk/sources/streams/http/requests_native_auth/abstract_oauth.py +3 -0
- {airbyte_cdk-6.33.2.dev0.dist-info → airbyte_cdk-6.33.3.dist-info}/METADATA +1 -1
- {airbyte_cdk-6.33.2.dev0.dist-info → airbyte_cdk-6.33.3.dist-info}/RECORD +19 -19
- {airbyte_cdk-6.33.2.dev0.dist-info → airbyte_cdk-6.33.3.dist-info}/LICENSE.txt +0 -0
- {airbyte_cdk-6.33.2.dev0.dist-info → airbyte_cdk-6.33.3.dist-info}/LICENSE_SHORT +0 -0
- {airbyte_cdk-6.33.2.dev0.dist-info → airbyte_cdk-6.33.3.dist-info}/WHEEL +0 -0
- {airbyte_cdk-6.33.2.dev0.dist-info → airbyte_cdk-6.33.3.dist-info}/entry_points.txt +0 -0
@@ -137,10 +137,6 @@ class ManifestDeclarativeSource(DeclarativeSource):
|
|
137
137
|
self._source_config, config
|
138
138
|
)
|
139
139
|
|
140
|
-
api_budget_model = self._source_config.get("api_budget")
|
141
|
-
if api_budget_model:
|
142
|
-
self._constructor.set_api_budget(api_budget_model, config)
|
143
|
-
|
144
140
|
source_streams = [
|
145
141
|
self._constructor.create_component(
|
146
142
|
DeclarativeStreamModel,
|
@@ -3,7 +3,6 @@
|
|
3
3
|
|
4
4
|
from __future__ import annotations
|
5
5
|
|
6
|
-
from datetime import datetime, timedelta
|
7
6
|
from enum import Enum
|
8
7
|
from typing import Any, Dict, List, Literal, Optional, Union
|
9
8
|
|
@@ -643,45 +642,6 @@ class OAuthAuthenticator(BaseModel):
|
|
643
642
|
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
|
644
643
|
|
645
644
|
|
646
|
-
class Rate(BaseModel):
|
647
|
-
class Config:
|
648
|
-
extra = Extra.allow
|
649
|
-
|
650
|
-
limit: int = Field(
|
651
|
-
...,
|
652
|
-
description="The maximum number of calls allowed within the interval.",
|
653
|
-
title="Limit",
|
654
|
-
)
|
655
|
-
interval: timedelta = Field(
|
656
|
-
..., description="The time interval for the rate limit.", title="Interval"
|
657
|
-
)
|
658
|
-
|
659
|
-
|
660
|
-
class HttpRequestRegexMatcher(BaseModel):
|
661
|
-
class Config:
|
662
|
-
extra = Extra.allow
|
663
|
-
|
664
|
-
method: Optional[str] = Field(
|
665
|
-
None, description="The HTTP method to match (e.g., GET, POST).", title="Method"
|
666
|
-
)
|
667
|
-
url_base: Optional[str] = Field(
|
668
|
-
None,
|
669
|
-
description='The base URL (scheme and host, e.g. "https://api.example.com") to match.',
|
670
|
-
title="URL Base",
|
671
|
-
)
|
672
|
-
url_path_pattern: Optional[str] = Field(
|
673
|
-
None,
|
674
|
-
description="A regular expression pattern to match the URL path.",
|
675
|
-
title="URL Path Pattern",
|
676
|
-
)
|
677
|
-
params: Optional[Dict[str, Any]] = Field(
|
678
|
-
None, description="The query parameters to match.", title="Parameters"
|
679
|
-
)
|
680
|
-
headers: Optional[Dict[str, Any]] = Field(
|
681
|
-
None, description="The headers to match.", title="Headers"
|
682
|
-
)
|
683
|
-
|
684
|
-
|
685
645
|
class DpathExtractor(BaseModel):
|
686
646
|
type: Literal["DpathExtractor"]
|
687
647
|
field_path: List[str] = Field(
|
@@ -927,15 +887,6 @@ class CustomDecoder(BaseModel):
|
|
927
887
|
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
|
928
888
|
|
929
889
|
|
930
|
-
class GzipJsonDecoder(BaseModel):
|
931
|
-
class Config:
|
932
|
-
extra = Extra.allow
|
933
|
-
|
934
|
-
type: Literal["GzipJsonDecoder"]
|
935
|
-
encoding: Optional[str] = "utf-8"
|
936
|
-
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
|
937
|
-
|
938
|
-
|
939
890
|
class MinMaxDatetime(BaseModel):
|
940
891
|
type: Literal["MinMaxDatetime"]
|
941
892
|
datetime: str = Field(
|
@@ -1314,18 +1265,8 @@ class LegacySessionTokenAuthenticator(BaseModel):
|
|
1314
1265
|
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
|
1315
1266
|
|
1316
1267
|
|
1317
|
-
class
|
1318
|
-
type: Literal["
|
1319
|
-
encoding: Optional[str] = "utf-8"
|
1320
|
-
|
1321
|
-
|
1322
|
-
class JsonLineParser(BaseModel):
|
1323
|
-
type: Literal["JsonLineParser"]
|
1324
|
-
encoding: Optional[str] = "utf-8"
|
1325
|
-
|
1326
|
-
|
1327
|
-
class CsvParser(BaseModel):
|
1328
|
-
type: Literal["CsvParser"]
|
1268
|
+
class CsvDecoder(BaseModel):
|
1269
|
+
type: Literal["CsvDecoder"]
|
1329
1270
|
encoding: Optional[str] = "utf-8"
|
1330
1271
|
delimiter: Optional[str] = ","
|
1331
1272
|
|
@@ -1624,60 +1565,6 @@ class DatetimeBasedCursor(BaseModel):
|
|
1624
1565
|
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
|
1625
1566
|
|
1626
1567
|
|
1627
|
-
class FixedWindowCallRatePolicy(BaseModel):
|
1628
|
-
class Config:
|
1629
|
-
extra = Extra.allow
|
1630
|
-
|
1631
|
-
type: Literal["FixedWindowCallRatePolicy"]
|
1632
|
-
next_reset_ts: datetime = Field(
|
1633
|
-
...,
|
1634
|
-
description="The timestamp when the rate limit will reset.",
|
1635
|
-
title="Next Reset Timestamp",
|
1636
|
-
)
|
1637
|
-
period: timedelta = Field(
|
1638
|
-
..., description="The time interval for the rate limit window.", title="Period"
|
1639
|
-
)
|
1640
|
-
call_limit: int = Field(
|
1641
|
-
...,
|
1642
|
-
description="The maximum number of calls allowed within the period.",
|
1643
|
-
title="Call Limit",
|
1644
|
-
)
|
1645
|
-
matchers: List[HttpRequestRegexMatcher] = Field(
|
1646
|
-
...,
|
1647
|
-
description="List of matchers that define which requests this policy applies to.",
|
1648
|
-
title="Matchers",
|
1649
|
-
)
|
1650
|
-
|
1651
|
-
|
1652
|
-
class MovingWindowCallRatePolicy(BaseModel):
|
1653
|
-
class Config:
|
1654
|
-
extra = Extra.allow
|
1655
|
-
|
1656
|
-
type: Literal["MovingWindowCallRatePolicy"]
|
1657
|
-
rates: List[Rate] = Field(
|
1658
|
-
...,
|
1659
|
-
description="List of rates that define the call limits for different time intervals.",
|
1660
|
-
title="Rates",
|
1661
|
-
)
|
1662
|
-
matchers: List[HttpRequestRegexMatcher] = Field(
|
1663
|
-
...,
|
1664
|
-
description="List of matchers that define which requests this policy applies to.",
|
1665
|
-
title="Matchers",
|
1666
|
-
)
|
1667
|
-
|
1668
|
-
|
1669
|
-
class UnlimitedCallRatePolicy(BaseModel):
|
1670
|
-
class Config:
|
1671
|
-
extra = Extra.allow
|
1672
|
-
|
1673
|
-
type: Literal["UnlimitedCallRatePolicy"]
|
1674
|
-
matchers: List[HttpRequestRegexMatcher] = Field(
|
1675
|
-
...,
|
1676
|
-
description="List of matchers that define which requests this policy applies to.",
|
1677
|
-
title="Matchers",
|
1678
|
-
)
|
1679
|
-
|
1680
|
-
|
1681
1568
|
class DefaultErrorHandler(BaseModel):
|
1682
1569
|
type: Literal["DefaultErrorHandler"]
|
1683
1570
|
backoff_strategies: Optional[
|
@@ -1774,9 +1661,9 @@ class RecordSelector(BaseModel):
|
|
1774
1661
|
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
|
1775
1662
|
|
1776
1663
|
|
1777
|
-
class
|
1778
|
-
type: Literal["
|
1779
|
-
|
1664
|
+
class GzipDecoder(BaseModel):
|
1665
|
+
type: Literal["GzipDecoder"]
|
1666
|
+
decoder: Union[CsvDecoder, GzipDecoder, JsonDecoder, JsonlDecoder]
|
1780
1667
|
|
1781
1668
|
|
1782
1669
|
class Spec(BaseModel):
|
@@ -1809,84 +1696,18 @@ class CompositeErrorHandler(BaseModel):
|
|
1809
1696
|
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
|
1810
1697
|
|
1811
1698
|
|
1812
|
-
class APIBudget(BaseModel):
|
1813
|
-
class Config:
|
1814
|
-
extra = Extra.allow
|
1815
|
-
|
1816
|
-
type: Literal["APIBudget"]
|
1817
|
-
policies: List[
|
1818
|
-
Union[
|
1819
|
-
FixedWindowCallRatePolicy,
|
1820
|
-
MovingWindowCallRatePolicy,
|
1821
|
-
UnlimitedCallRatePolicy,
|
1822
|
-
]
|
1823
|
-
] = Field(
|
1824
|
-
...,
|
1825
|
-
description="List of call rate policies that define how many calls are allowed.",
|
1826
|
-
title="Policies",
|
1827
|
-
)
|
1828
|
-
maximum_attempts_to_acquire: Optional[int] = Field(
|
1829
|
-
100000,
|
1830
|
-
description="The maximum number of attempts to acquire a call before giving up.",
|
1831
|
-
title="Maximum Attempts to Acquire",
|
1832
|
-
)
|
1833
|
-
|
1834
|
-
|
1835
|
-
class HTTPAPIBudget(BaseModel):
|
1836
|
-
class Config:
|
1837
|
-
extra = Extra.allow
|
1838
|
-
|
1839
|
-
type: Literal["HTTPAPIBudget"]
|
1840
|
-
policies: List[
|
1841
|
-
Union[
|
1842
|
-
FixedWindowCallRatePolicy,
|
1843
|
-
MovingWindowCallRatePolicy,
|
1844
|
-
UnlimitedCallRatePolicy,
|
1845
|
-
]
|
1846
|
-
] = Field(
|
1847
|
-
...,
|
1848
|
-
description="List of call rate policies that define how many calls are allowed.",
|
1849
|
-
title="Policies",
|
1850
|
-
)
|
1851
|
-
ratelimit_reset_header: Optional[str] = Field(
|
1852
|
-
"ratelimit-reset",
|
1853
|
-
description="The HTTP response header name that indicates when the rate limit resets.",
|
1854
|
-
title="Rate Limit Reset Header",
|
1855
|
-
)
|
1856
|
-
ratelimit_remaining_header: Optional[str] = Field(
|
1857
|
-
"ratelimit-remaining",
|
1858
|
-
description="The HTTP response header name that indicates the number of remaining allowed calls.",
|
1859
|
-
title="Rate Limit Remaining Header",
|
1860
|
-
)
|
1861
|
-
status_codes_for_ratelimit_hit: Optional[List[int]] = Field(
|
1862
|
-
[429],
|
1863
|
-
description="List of HTTP status codes that indicate a rate limit has been hit.",
|
1864
|
-
title="Status Codes for Rate Limit Hit",
|
1865
|
-
)
|
1866
|
-
maximum_attempts_to_acquire: Optional[int] = Field(
|
1867
|
-
100000,
|
1868
|
-
description="The maximum number of attempts to acquire a call before giving up.",
|
1869
|
-
title="Maximum Attempts to Acquire",
|
1870
|
-
)
|
1871
|
-
|
1872
|
-
|
1873
1699
|
class ZipfileDecoder(BaseModel):
|
1874
1700
|
class Config:
|
1875
1701
|
extra = Extra.allow
|
1876
1702
|
|
1877
1703
|
type: Literal["ZipfileDecoder"]
|
1878
|
-
|
1704
|
+
decoder: Union[CsvDecoder, GzipDecoder, JsonDecoder, JsonlDecoder] = Field(
|
1879
1705
|
...,
|
1880
1706
|
description="Parser to parse the decompressed data from the zipfile(s).",
|
1881
1707
|
title="Parser",
|
1882
1708
|
)
|
1883
1709
|
|
1884
1710
|
|
1885
|
-
class CompositeRawDecoder(BaseModel):
|
1886
|
-
type: Literal["CompositeRawDecoder"]
|
1887
|
-
parser: Union[GzipParser, JsonParser, JsonLineParser, CsvParser]
|
1888
|
-
|
1889
|
-
|
1890
1711
|
class DeclarativeSource1(BaseModel):
|
1891
1712
|
class Config:
|
1892
1713
|
extra = Extra.forbid
|
@@ -1903,11 +1724,6 @@ class DeclarativeSource1(BaseModel):
|
|
1903
1724
|
definitions: Optional[Dict[str, Any]] = None
|
1904
1725
|
spec: Optional[Spec] = None
|
1905
1726
|
concurrency_level: Optional[ConcurrencyLevel] = None
|
1906
|
-
api_budget: Optional[Union[APIBudget, HTTPAPIBudget]] = Field(
|
1907
|
-
None,
|
1908
|
-
description="Defines how many requests can be made to the API in a given time frame. This field accepts either a generic APIBudget or an HTTP-specific configuration (HTTPAPIBudget) to be applied across all streams.",
|
1909
|
-
title="API Budget",
|
1910
|
-
)
|
1911
1727
|
metadata: Optional[Dict[str, Any]] = Field(
|
1912
1728
|
None,
|
1913
1729
|
description="For internal Airbyte use only - DO NOT modify manually. Used by consumers of declarative manifests for storing related metadata.",
|
@@ -1934,11 +1750,6 @@ class DeclarativeSource2(BaseModel):
|
|
1934
1750
|
definitions: Optional[Dict[str, Any]] = None
|
1935
1751
|
spec: Optional[Spec] = None
|
1936
1752
|
concurrency_level: Optional[ConcurrencyLevel] = None
|
1937
|
-
api_budget: Optional[Union[APIBudget, HTTPAPIBudget]] = Field(
|
1938
|
-
None,
|
1939
|
-
description="Defines how many requests can be made to the API in a given time frame. This field accepts either a generic APIBudget or an HTTP-specific configuration (HTTPAPIBudget) to be applied across all streams.",
|
1940
|
-
title="API Budget",
|
1941
|
-
)
|
1942
1753
|
metadata: Optional[Dict[str, Any]] = Field(
|
1943
1754
|
None,
|
1944
1755
|
description="For internal Airbyte use only - DO NOT modify manually. Used by consumers of declarative manifests for storing related metadata.",
|
@@ -2098,7 +1909,7 @@ class SessionTokenAuthenticator(BaseModel):
|
|
2098
1909
|
description="Authentication method to use for requests sent to the API, specifying how to inject the session token.",
|
2099
1910
|
title="Data Request Authentication",
|
2100
1911
|
)
|
2101
|
-
decoder: Optional[Union[JsonDecoder, XmlDecoder
|
1912
|
+
decoder: Optional[Union[JsonDecoder, XmlDecoder]] = Field(
|
2102
1913
|
None, description="Component used to decode the response.", title="Decoder"
|
2103
1914
|
)
|
2104
1915
|
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
|
@@ -2298,12 +2109,12 @@ class SimpleRetriever(BaseModel):
|
|
2298
2109
|
decoder: Optional[
|
2299
2110
|
Union[
|
2300
2111
|
CustomDecoder,
|
2112
|
+
CsvDecoder,
|
2113
|
+
GzipDecoder,
|
2301
2114
|
JsonDecoder,
|
2302
2115
|
JsonlDecoder,
|
2303
2116
|
IterableDecoder,
|
2304
2117
|
XmlDecoder,
|
2305
|
-
GzipJsonDecoder,
|
2306
|
-
CompositeRawDecoder,
|
2307
2118
|
ZipfileDecoder,
|
2308
2119
|
]
|
2309
2120
|
] = Field(
|
@@ -2376,12 +2187,12 @@ class AsyncRetriever(BaseModel):
|
|
2376
2187
|
decoder: Optional[
|
2377
2188
|
Union[
|
2378
2189
|
CustomDecoder,
|
2190
|
+
CsvDecoder,
|
2191
|
+
GzipDecoder,
|
2379
2192
|
JsonDecoder,
|
2380
2193
|
JsonlDecoder,
|
2381
2194
|
IterableDecoder,
|
2382
2195
|
XmlDecoder,
|
2383
|
-
GzipJsonDecoder,
|
2384
|
-
CompositeRawDecoder,
|
2385
2196
|
ZipfileDecoder,
|
2386
2197
|
]
|
2387
2198
|
] = Field(
|
@@ -2392,12 +2203,12 @@ class AsyncRetriever(BaseModel):
|
|
2392
2203
|
download_decoder: Optional[
|
2393
2204
|
Union[
|
2394
2205
|
CustomDecoder,
|
2206
|
+
CsvDecoder,
|
2207
|
+
GzipDecoder,
|
2395
2208
|
JsonDecoder,
|
2396
2209
|
JsonlDecoder,
|
2397
2210
|
IterableDecoder,
|
2398
2211
|
XmlDecoder,
|
2399
|
-
GzipJsonDecoder,
|
2400
|
-
CompositeRawDecoder,
|
2401
2212
|
ZipfileDecoder,
|
2402
2213
|
]
|
2403
2214
|
] = Field(
|
@@ -2442,6 +2253,7 @@ class DynamicDeclarativeStream(BaseModel):
|
|
2442
2253
|
|
2443
2254
|
|
2444
2255
|
ComplexFieldType.update_forward_refs()
|
2256
|
+
GzipDecoder.update_forward_refs()
|
2445
2257
|
CompositeErrorHandler.update_forward_refs()
|
2446
2258
|
DeclarativeSource1.update_forward_refs()
|
2447
2259
|
DeclarativeSource2.update_forward_refs()
|