airbyte-cdk 6.34.1.dev1__py3-none-any.whl → 6.36.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.
- airbyte_cdk/sources/declarative/declarative_component_schema.yaml +15 -1
- airbyte_cdk/sources/declarative/decoders/composite_raw_decoder.py +11 -1
- airbyte_cdk/sources/declarative/interpolation/__init__.py +1 -1
- airbyte_cdk/sources/declarative/interpolation/filters.py +2 -1
- airbyte_cdk/sources/declarative/interpolation/interpolated_boolean.py +1 -1
- airbyte_cdk/sources/declarative/interpolation/interpolated_mapping.py +1 -1
- airbyte_cdk/sources/declarative/interpolation/interpolated_nested_mapping.py +1 -1
- airbyte_cdk/sources/declarative/interpolation/interpolated_string.py +1 -1
- airbyte_cdk/sources/declarative/interpolation/interpolation.py +2 -1
- airbyte_cdk/sources/declarative/interpolation/jinja.py +1 -1
- airbyte_cdk/sources/declarative/interpolation/macros.py +19 -4
- airbyte_cdk/sources/declarative/models/declarative_component_schema.py +1 -1
- airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py +2 -1
- {airbyte_cdk-6.34.1.dev1.dist-info → airbyte_cdk-6.36.0.dist-info}/METADATA +1 -1
- {airbyte_cdk-6.34.1.dev1.dist-info → airbyte_cdk-6.36.0.dist-info}/RECORD +19 -19
- {airbyte_cdk-6.34.1.dev1.dist-info → airbyte_cdk-6.36.0.dist-info}/LICENSE.txt +0 -0
- {airbyte_cdk-6.34.1.dev1.dist-info → airbyte_cdk-6.36.0.dist-info}/LICENSE_SHORT +0 -0
- {airbyte_cdk-6.34.1.dev1.dist-info → airbyte_cdk-6.36.0.dist-info}/WHEEL +0 -0
- {airbyte_cdk-6.34.1.dev1.dist-info → airbyte_cdk-6.36.0.dist-info}/entry_points.txt +0 -0
@@ -1490,7 +1490,11 @@ definitions:
|
|
1490
1490
|
limit:
|
1491
1491
|
title: Limit
|
1492
1492
|
description: The maximum number of calls allowed within the interval.
|
1493
|
-
|
1493
|
+
anyOf:
|
1494
|
+
- type: integer
|
1495
|
+
- type: string
|
1496
|
+
interpolation_context:
|
1497
|
+
- config
|
1494
1498
|
interval:
|
1495
1499
|
title: Interval
|
1496
1500
|
description: The time interval for the rate limit.
|
@@ -3744,6 +3748,16 @@ interpolation:
|
|
3744
3748
|
- "{{ format_datetime(config['start_time'], '%Y-%m-%d') }}"
|
3745
3749
|
- "{{ format_datetime(config['start_date'], '%Y-%m-%dT%H:%M:%S.%fZ') }}"
|
3746
3750
|
- "{{ format_datetime(config['start_date'], '%Y-%m-%dT%H:%M:%S.%fZ', '%a, %d %b %Y %H:%M:%S %z') }}"
|
3751
|
+
- title: str_to_datetime
|
3752
|
+
description: Converts a string to a datetime object with UTC timezone.
|
3753
|
+
arguments:
|
3754
|
+
s: The string to convert.
|
3755
|
+
return_type: datetime.datetime
|
3756
|
+
examples:
|
3757
|
+
- "{{ str_to_datetime('2022-01-14') }}"
|
3758
|
+
- "{{ str_to_datetime('2022-01-01 13:45:30') }}"
|
3759
|
+
- "{{ str_to_datetime('2022-01-01T13:45:30+00:00') }}"
|
3760
|
+
- "{{ str_to_datetime('2022-01-01T13:45:30.123456Z') }}"
|
3747
3761
|
filters:
|
3748
3762
|
- title: hash
|
3749
3763
|
description: Convert the specified value to a hashed string.
|
@@ -107,6 +107,16 @@ class CsvParser(Parser):
|
|
107
107
|
encoding: Optional[str] = "utf-8"
|
108
108
|
delimiter: Optional[str] = ","
|
109
109
|
|
110
|
+
def _get_delimiter(self) -> Optional[str]:
|
111
|
+
"""
|
112
|
+
Get delimiter from the configuration. Check for the escape character and decode it.
|
113
|
+
"""
|
114
|
+
if self.delimiter is not None:
|
115
|
+
if self.delimiter.startswith("\\"):
|
116
|
+
self.delimiter = self.delimiter.encode("utf-8").decode("unicode_escape")
|
117
|
+
|
118
|
+
return self.delimiter
|
119
|
+
|
110
120
|
def parse(
|
111
121
|
self,
|
112
122
|
data: BufferedIOBase,
|
@@ -115,7 +125,7 @@ class CsvParser(Parser):
|
|
115
125
|
Parse CSV data from decompressed bytes.
|
116
126
|
"""
|
117
127
|
text_data = TextIOWrapper(data, encoding=self.encoding) # type: ignore
|
118
|
-
reader = csv.DictReader(text_data, delimiter=self.
|
128
|
+
reader = csv.DictReader(text_data, delimiter=self._get_delimiter() or ",")
|
119
129
|
yield from reader
|
120
130
|
|
121
131
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c)
|
2
|
+
# Copyright (c) 2025 Airbyte, Inc., all rights reserved.
|
3
3
|
#
|
4
4
|
|
5
5
|
import builtins
|
@@ -63,10 +63,24 @@ def timestamp(dt: Union[float, str]) -> Union[int, float]:
|
|
63
63
|
if isinstance(dt, (int, float)):
|
64
64
|
return int(dt)
|
65
65
|
else:
|
66
|
-
return
|
66
|
+
return str_to_datetime(dt).astimezone(pytz.utc).timestamp()
|
67
67
|
|
68
68
|
|
69
|
-
def
|
69
|
+
def str_to_datetime(s: str) -> datetime.datetime:
|
70
|
+
"""
|
71
|
+
Converts a string to a datetime object with UTC timezone
|
72
|
+
|
73
|
+
If the input string does not contain timezone information, UTC is assumed.
|
74
|
+
Supports both basic date strings like "2022-01-14" and datetime strings with optional timezone
|
75
|
+
like "2022-01-01T13:45:30+00:00".
|
76
|
+
|
77
|
+
Usage:
|
78
|
+
`"{{ str_to_datetime('2022-01-14') }}"`
|
79
|
+
|
80
|
+
:param s: string to parse as datetime
|
81
|
+
:return: datetime object in UTC timezone
|
82
|
+
"""
|
83
|
+
|
70
84
|
parsed_date = parser.isoparse(s)
|
71
85
|
if not parsed_date.tzinfo:
|
72
86
|
# Assume UTC if the input does not contain a timezone
|
@@ -155,7 +169,7 @@ def format_datetime(
|
|
155
169
|
if isinstance(dt, datetime.datetime):
|
156
170
|
return dt.strftime(format)
|
157
171
|
dt_datetime = (
|
158
|
-
datetime.datetime.strptime(dt, input_format) if input_format else
|
172
|
+
datetime.datetime.strptime(dt, input_format) if input_format else str_to_datetime(dt)
|
159
173
|
)
|
160
174
|
if format == "%s":
|
161
175
|
return str(int(dt_datetime.timestamp()))
|
@@ -172,5 +186,6 @@ _macros_list = [
|
|
172
186
|
duration,
|
173
187
|
format_datetime,
|
174
188
|
today_with_timezone,
|
189
|
+
str_to_datetime,
|
175
190
|
]
|
176
191
|
macros = {f.__name__: f for f in _macros_list}
|
@@ -3024,8 +3024,9 @@ class ModelToComponentFactory:
|
|
3024
3024
|
)
|
3025
3025
|
|
3026
3026
|
def create_rate(self, model: RateModel, config: Config, **kwargs: Any) -> Rate:
|
3027
|
+
interpolated_limit = InterpolatedString.create(str(model.limit), parameters={})
|
3027
3028
|
return Rate(
|
3028
|
-
limit=
|
3029
|
+
limit=int(interpolated_limit.eval(config=config)),
|
3029
3030
|
interval=parse_duration(model.interval),
|
3030
3031
|
)
|
3031
3032
|
|
@@ -71,11 +71,11 @@ airbyte_cdk/sources/declarative/concurrent_declarative_source.py,sha256=KBF9wdPC
|
|
71
71
|
airbyte_cdk/sources/declarative/datetime/__init__.py,sha256=l9LG7Qm6e5r_qgqfVKnx3mXYtg1I9MmMjomVIPfU4XA,177
|
72
72
|
airbyte_cdk/sources/declarative/datetime/datetime_parser.py,sha256=SX9JjdesN1edN2WVUVMzU_ptqp2QB1OnsnjZ4mwcX7w,2579
|
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=
|
74
|
+
airbyte_cdk/sources/declarative/declarative_component_schema.yaml,sha256=5o5GsltzbVL2jyXvjWzUoV_r5xpwG_YdLSVUuG_d_34,144548
|
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
|
78
|
-
airbyte_cdk/sources/declarative/decoders/composite_raw_decoder.py,sha256=
|
78
|
+
airbyte_cdk/sources/declarative/decoders/composite_raw_decoder.py,sha256=gdsi2p23uxyw1Ra8RCmsTpAZeDi375kQxz_UK0sURb8,4923
|
79
79
|
airbyte_cdk/sources/declarative/decoders/decoder.py,sha256=sl-Gt8lXi7yD2Q-sD8je5QS2PbgrgsYjxRLWsay7DMc,826
|
80
80
|
airbyte_cdk/sources/declarative/decoders/json_decoder.py,sha256=BdWpXXPhEGf_zknggJmhojLosmxuw51RBVTS0jvdCPc,2080
|
81
81
|
airbyte_cdk/sources/declarative/decoders/noop_decoder.py,sha256=iZh0yKY_JzgBnJWiubEusf5c0o6Khd-8EWFWT-8EgFo,542
|
@@ -99,27 +99,27 @@ airbyte_cdk/sources/declarative/incremental/global_substream_cursor.py,sha256=2t
|
|
99
99
|
airbyte_cdk/sources/declarative/incremental/per_partition_cursor.py,sha256=9IAJTCiRUXvhFFz-IhZtYh_KfAjLHqthsYf2jErQRls,17728
|
100
100
|
airbyte_cdk/sources/declarative/incremental/per_partition_with_global.py,sha256=2YBOA2NnwAeIKlIhSwUB_W-FaGnPcmrG_liY7b4mV2Y,8365
|
101
101
|
airbyte_cdk/sources/declarative/incremental/resumable_full_refresh_cursor.py,sha256=10LFv1QPM-agVKl6eaANmEBOfd7gZgBrkoTcMggsieQ,4809
|
102
|
-
airbyte_cdk/sources/declarative/interpolation/__init__.py,sha256=
|
103
|
-
airbyte_cdk/sources/declarative/interpolation/filters.py,sha256=
|
104
|
-
airbyte_cdk/sources/declarative/interpolation/interpolated_boolean.py,sha256=
|
105
|
-
airbyte_cdk/sources/declarative/interpolation/interpolated_mapping.py,sha256=
|
106
|
-
airbyte_cdk/sources/declarative/interpolation/interpolated_nested_mapping.py,sha256=
|
107
|
-
airbyte_cdk/sources/declarative/interpolation/interpolated_string.py,sha256=
|
108
|
-
airbyte_cdk/sources/declarative/interpolation/interpolation.py,sha256
|
109
|
-
airbyte_cdk/sources/declarative/interpolation/jinja.py,sha256=
|
110
|
-
airbyte_cdk/sources/declarative/interpolation/macros.py,sha256=
|
102
|
+
airbyte_cdk/sources/declarative/interpolation/__init__.py,sha256=Kh7FxhfetyNVDnAQ9zSxNe4oUbb8CvoW7Mqz7cs2iPg,437
|
103
|
+
airbyte_cdk/sources/declarative/interpolation/filters.py,sha256=JXdjSmi6eTUTA-qBoR9wSmXlEYvVCOZRKq2GhkDg09M,3640
|
104
|
+
airbyte_cdk/sources/declarative/interpolation/interpolated_boolean.py,sha256=8F3ntT_Mfo8cO9n6dCq8rTfJIpfKmzRCsVtVdhzaoGc,1964
|
105
|
+
airbyte_cdk/sources/declarative/interpolation/interpolated_mapping.py,sha256=h36RIng4GZ9v4o_fRmgJjTNOtWmhK7NOILU1oSKPE4Q,2083
|
106
|
+
airbyte_cdk/sources/declarative/interpolation/interpolated_nested_mapping.py,sha256=vjwvkLk7_l6YDcFClwjCMcTleRjQBh7-dzny7PUaoG8,1857
|
107
|
+
airbyte_cdk/sources/declarative/interpolation/interpolated_string.py,sha256=CQkHqGlfa87G6VYMtBAQWin7ECKpfMdrDcg0JO5_rhc,3212
|
108
|
+
airbyte_cdk/sources/declarative/interpolation/interpolation.py,sha256=9IoeuWam3L6GyN10L6U8xNWXmkt9cnahSDNkez1OmFY,982
|
109
|
+
airbyte_cdk/sources/declarative/interpolation/jinja.py,sha256=UQeuS4Vpyp4hlOn-R3tRyeBX0e9IoV6jQ6gH-Jz8lY0,7182
|
110
|
+
airbyte_cdk/sources/declarative/interpolation/macros.py,sha256=ajgVJT9sZBUFZUDLjzyPWupCNXt1HvzbCq-4yv9aY3c,5042
|
111
111
|
airbyte_cdk/sources/declarative/manifest_declarative_source.py,sha256=TN6GCgLXaWDONTaJwQ3A5ELqC-sxwKz-UYSraJYB-dI,17078
|
112
112
|
airbyte_cdk/sources/declarative/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
113
113
|
airbyte_cdk/sources/declarative/migrations/legacy_to_per_partition_state_migration.py,sha256=iemy3fKLczcU0-Aor7tx5jcT6DRedKMqyK7kCOp01hg,3924
|
114
114
|
airbyte_cdk/sources/declarative/migrations/state_migration.py,sha256=KWPjealMLKSMtajXgkdGgKg7EmTLR-CqqD7UIh0-eDU,794
|
115
115
|
airbyte_cdk/sources/declarative/models/__init__.py,sha256=nUFxNCiKeYRVXuZEKA7GD-lTHxsiKcQ8FitZjKhPIvE,100
|
116
|
-
airbyte_cdk/sources/declarative/models/declarative_component_schema.py,sha256=
|
116
|
+
airbyte_cdk/sources/declarative/models/declarative_component_schema.py,sha256=gNL9DqajD2A8UBnKAz7F7YQuYH7frQyHiPQPIMGq2xo,101958
|
117
117
|
airbyte_cdk/sources/declarative/parsers/__init__.py,sha256=ZnqYNxHsKCgO38IwB34RQyRMXTs4GTvlRi3ImKnIioo,61
|
118
118
|
airbyte_cdk/sources/declarative/parsers/custom_code_compiler.py,sha256=958MMX6_ZOJUlDDdNr9Krosgi2bCKGx2Z765M2Woz18,5505
|
119
119
|
airbyte_cdk/sources/declarative/parsers/custom_exceptions.py,sha256=Rir9_z3Kcd5Es0-LChrzk-0qubAsiK_RSEnLmK2OXm8,553
|
120
120
|
airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py,sha256=CXwTfD3wSQq3okcqwigpprbHhSURUokh4GK2OmOyKC8,9132
|
121
121
|
airbyte_cdk/sources/declarative/parsers/manifest_reference_resolver.py,sha256=IWUOdF03o-aQn0Occo1BJCxU0Pz-QILk5L67nzw2thw,6803
|
122
|
-
airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=
|
122
|
+
airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=rzpnKibRapjo6AbcWEYZK5g9EkheDBZbIzokamBBOfM,133870
|
123
123
|
airbyte_cdk/sources/declarative/partition_routers/__init__.py,sha256=HJ-Syp3p7RpyR_OK0X_a2kSyISfu3W-PKrRI16iY0a8,957
|
124
124
|
airbyte_cdk/sources/declarative/partition_routers/async_job_partition_router.py,sha256=VelO7zKqKtzMJ35jyFeg0ypJLQC0plqqIBNXoBW1G2E,3001
|
125
125
|
airbyte_cdk/sources/declarative/partition_routers/cartesian_product_stream_slicer.py,sha256=c5cuVFM6NFkuQqG8Z5IwkBuwDrvXZN1CunUOM_L0ezg,6892
|
@@ -360,9 +360,9 @@ airbyte_cdk/utils/slice_hasher.py,sha256=EDxgROHDbfG-QKQb59m7h_7crN1tRiawdf5uU7G
|
|
360
360
|
airbyte_cdk/utils/spec_schema_transformations.py,sha256=-5HTuNsnDBAhj-oLeQXwpTGA0HdcjFOf2zTEMUTTg_Y,816
|
361
361
|
airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
|
362
362
|
airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
|
363
|
-
airbyte_cdk-6.
|
364
|
-
airbyte_cdk-6.
|
365
|
-
airbyte_cdk-6.
|
366
|
-
airbyte_cdk-6.
|
367
|
-
airbyte_cdk-6.
|
368
|
-
airbyte_cdk-6.
|
363
|
+
airbyte_cdk-6.36.0.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
|
364
|
+
airbyte_cdk-6.36.0.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
|
365
|
+
airbyte_cdk-6.36.0.dist-info/METADATA,sha256=7MbJBt_9MFJsgusffTfvZsiz-2OJoOwAq9FDwrDQth4,6010
|
366
|
+
airbyte_cdk-6.36.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
367
|
+
airbyte_cdk-6.36.0.dist-info/entry_points.txt,sha256=fj-e3PAQvsxsQzyyq8UkG1k8spunWnD4BAH2AwlR6NM,95
|
368
|
+
airbyte_cdk-6.36.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|