airbyte-cdk 6.57.3.post7.dev16093585744__py3-none-any.whl → 6.58.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 +6 -0
- airbyte_cdk/sources/declarative/models/declarative_component_schema.py +7 -0
- airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py +7 -0
- airbyte_cdk/sources/declarative/requesters/http_requester.py +0 -1
- airbyte_cdk/sources/streams/http/http.py +0 -1
- airbyte_cdk/sources/streams/http/http_client.py +3 -6
- airbyte_cdk/sources/streams/http/rate_limiting.py +2 -9
- airbyte_cdk/sources/streams/http/requests_native_auth/abstract_oauth.py +20 -9
- {airbyte_cdk-6.57.3.post7.dev16093585744.dist-info → airbyte_cdk-6.58.0.dist-info}/METADATA +1 -1
- {airbyte_cdk-6.57.3.post7.dev16093585744.dist-info → airbyte_cdk-6.58.0.dist-info}/RECORD +14 -14
- {airbyte_cdk-6.57.3.post7.dev16093585744.dist-info → airbyte_cdk-6.58.0.dist-info}/LICENSE.txt +0 -0
- {airbyte_cdk-6.57.3.post7.dev16093585744.dist-info → airbyte_cdk-6.58.0.dist-info}/LICENSE_SHORT +0 -0
- {airbyte_cdk-6.57.3.post7.dev16093585744.dist-info → airbyte_cdk-6.58.0.dist-info}/WHEEL +0 -0
- {airbyte_cdk-6.57.3.post7.dev16093585744.dist-info → airbyte_cdk-6.58.0.dist-info}/entry_points.txt +0 -0
@@ -2043,9 +2043,15 @@ definitions:
|
|
2043
2043
|
- "$ref": "#/definitions/NoAuth"
|
2044
2044
|
- "$ref": "#/definitions/LegacySessionTokenAuthenticator"
|
2045
2045
|
fetch_properties_from_endpoint:
|
2046
|
+
deprecated: true
|
2047
|
+
deprecation_message: "Use `query_properties` field instead."
|
2046
2048
|
title: Fetch Properties from Endpoint
|
2047
2049
|
description: Allows for retrieving a dynamic set of properties from an API endpoint which can be injected into outbound request using the stream_partition.extra_fields.
|
2048
2050
|
"$ref": "#/definitions/PropertiesFromEndpoint"
|
2051
|
+
query_properties:
|
2052
|
+
title: Query Properties
|
2053
|
+
description: For APIs that require explicit specification of the properties to query for, this component will take a static or dynamic set of properties (which can be optionally split into chunks) and allow them to be injected into an outbound request by accessing stream_partition.extra_fields.
|
2054
|
+
"$ref": "#/definitions/QueryProperties"
|
2049
2055
|
request_parameters:
|
2050
2056
|
title: Query Parameters
|
2051
2057
|
description: Specifies the query parameters that should be set on an outgoing HTTP request given the inputs.
|
@@ -2543,9 +2543,16 @@ class HttpRequester(BaseModelWithDeprecations):
|
|
2543
2543
|
)
|
2544
2544
|
fetch_properties_from_endpoint: Optional[PropertiesFromEndpoint] = Field(
|
2545
2545
|
None,
|
2546
|
+
deprecated=True,
|
2547
|
+
deprecation_message="Use `query_properties` field instead.",
|
2546
2548
|
description="Allows for retrieving a dynamic set of properties from an API endpoint which can be injected into outbound request using the stream_partition.extra_fields.",
|
2547
2549
|
title="Fetch Properties from Endpoint",
|
2548
2550
|
)
|
2551
|
+
query_properties: Optional[QueryProperties] = Field(
|
2552
|
+
None,
|
2553
|
+
description="For APIs that require explicit specification of the properties to query for, this component will take a static or dynamic set of properties (which can be optionally split into chunks) and allow them to be injected into an outbound request by accessing stream_partition.extra_fields.",
|
2554
|
+
title="Query Properties",
|
2555
|
+
)
|
2549
2556
|
request_parameters: Optional[Union[Dict[str, Union[str, QueryProperties]], str]] = Field(
|
2550
2557
|
None,
|
2551
2558
|
description="Specifies the query parameters that should be set on an outgoing HTTP request given the inputs.",
|
@@ -2801,6 +2801,7 @@ class ModelToComponentFactory:
|
|
2801
2801
|
).eval(config),
|
2802
2802
|
scopes=model.scopes,
|
2803
2803
|
token_expiry_date_format=model.token_expiry_date_format,
|
2804
|
+
token_expiry_is_time_of_expiration=bool(model.token_expiry_date_format),
|
2804
2805
|
message_repository=self._message_repository,
|
2805
2806
|
refresh_token_error_status_codes=model.refresh_token_updater.refresh_token_error_status_codes,
|
2806
2807
|
refresh_token_error_key=model.refresh_token_updater.refresh_token_error_key,
|
@@ -3220,6 +3221,7 @@ class ModelToComponentFactory:
|
|
3220
3221
|
hasattr(model.requester, "fetch_properties_from_endpoint")
|
3221
3222
|
and model.requester.fetch_properties_from_endpoint
|
3222
3223
|
):
|
3224
|
+
# todo: Deprecate this condition once dependent connectors migrate to query_properties
|
3223
3225
|
query_properties_definition = QueryPropertiesModel(
|
3224
3226
|
type="QueryProperties",
|
3225
3227
|
property_list=model.requester.fetch_properties_from_endpoint,
|
@@ -3231,6 +3233,11 @@ class ModelToComponentFactory:
|
|
3231
3233
|
model=query_properties_definition,
|
3232
3234
|
config=config,
|
3233
3235
|
)
|
3236
|
+
elif hasattr(model.requester, "query_properties") and model.requester.query_properties:
|
3237
|
+
query_properties = self.create_query_properties(
|
3238
|
+
model=model.requester.query_properties,
|
3239
|
+
config=config,
|
3240
|
+
)
|
3234
3241
|
|
3235
3242
|
requester = self._create_component_from_model(
|
3236
3243
|
model=model.requester,
|
@@ -243,7 +243,6 @@ class HttpClient:
|
|
243
243
|
request_kwargs: Mapping[str, Any],
|
244
244
|
log_formatter: Optional[Callable[[requests.Response], Any]] = None,
|
245
245
|
exit_on_rate_limit: Optional[bool] = False,
|
246
|
-
stream_slice: Optional[Mapping[str, Any]] = None,
|
247
246
|
) -> requests.Response:
|
248
247
|
"""
|
249
248
|
Sends a request with retry logic.
|
@@ -260,9 +259,9 @@ class HttpClient:
|
|
260
259
|
max_tries = max(0, max_retries) + 1
|
261
260
|
max_time = self._max_time
|
262
261
|
|
263
|
-
user_backoff_handler = user_defined_backoff_handler(
|
264
|
-
|
265
|
-
)
|
262
|
+
user_backoff_handler = user_defined_backoff_handler(max_tries=max_tries, max_time=max_time)(
|
263
|
+
self._send
|
264
|
+
)
|
266
265
|
rate_limit_backoff_handler = rate_limit_default_backoff_handler(max_tries=max_tries)
|
267
266
|
backoff_handler = http_client_default_backoff_handler(
|
268
267
|
max_tries=max_tries, max_time=max_time
|
@@ -507,7 +506,6 @@ class HttpClient:
|
|
507
506
|
dedupe_query_params: bool = False,
|
508
507
|
log_formatter: Optional[Callable[[requests.Response], Any]] = None,
|
509
508
|
exit_on_rate_limit: Optional[bool] = False,
|
510
|
-
stream_slice: Optional[Mapping[str, Any]] = None,
|
511
509
|
) -> Tuple[requests.PreparedRequest, requests.Response]:
|
512
510
|
"""
|
513
511
|
Prepares and sends request and return request and response objects.
|
@@ -528,7 +526,6 @@ class HttpClient:
|
|
528
526
|
request_kwargs=request_kwargs,
|
529
527
|
log_formatter=log_formatter,
|
530
528
|
exit_on_rate_limit=exit_on_rate_limit,
|
531
|
-
stream_slice=stream_slice,
|
532
529
|
)
|
533
530
|
|
534
531
|
return request, response
|
@@ -101,10 +101,7 @@ def http_client_default_backoff_handler(
|
|
101
101
|
|
102
102
|
|
103
103
|
def user_defined_backoff_handler(
|
104
|
-
max_tries: Optional[int],
|
105
|
-
max_time: Optional[int] = None,
|
106
|
-
stream_slice: Optional[Mapping[str, Any]] = None,
|
107
|
-
**kwargs: Any,
|
104
|
+
max_tries: Optional[int], max_time: Optional[int] = None, **kwargs: Any
|
108
105
|
) -> Callable[[SendRequestCallableType], SendRequestCallableType]:
|
109
106
|
def sleep_on_ratelimit(details: Mapping[str, Any]) -> None:
|
110
107
|
_, exc, _ = sys.exc_info()
|
@@ -114,11 +111,7 @@ def user_defined_backoff_handler(
|
|
114
111
|
f"Status code: {exc.response.status_code!r}, Response Content: {exc.response.content!r}"
|
115
112
|
)
|
116
113
|
retry_after = exc.backoff
|
117
|
-
|
118
|
-
logging_message = f"Retrying. Sleeping for {retry_after} seconds at {time.strftime('%Y-%m-%d %H:%M:%S')}"
|
119
|
-
if stream_slice:
|
120
|
-
logging_message += f" for slice: {stream_slice}"
|
121
|
-
logger.info(logging_message)
|
114
|
+
logger.info(f"Retrying. Sleeping for {retry_after} seconds")
|
122
115
|
time.sleep(retry_after + 1) # extra second to cover any fractions of second
|
123
116
|
|
124
117
|
def log_give_up(details: Mapping[str, Any]) -> None:
|
@@ -217,10 +217,26 @@ class AbstractOauth2Authenticator(AuthBase):
|
|
217
217
|
data=self.build_refresh_request_body(),
|
218
218
|
headers=self.build_refresh_request_headers(),
|
219
219
|
)
|
220
|
-
|
220
|
+
|
221
|
+
if not response.ok:
|
222
|
+
# log the response even if the request failed for troubleshooting purposes
|
223
|
+
self._log_response(response)
|
224
|
+
response.raise_for_status()
|
225
|
+
|
226
|
+
response_json = response.json()
|
227
|
+
|
228
|
+
try:
|
229
|
+
# extract the access token and add to secrets to avoid logging the raw value
|
230
|
+
access_key = self._extract_access_token(response_json)
|
231
|
+
if access_key:
|
232
|
+
add_to_secrets(access_key)
|
233
|
+
except ResponseKeysMaxRecurtionReached as e:
|
234
|
+
# could not find the access token in the response, so do nothing
|
235
|
+
pass
|
236
|
+
|
221
237
|
self._log_response(response)
|
222
|
-
|
223
|
-
return
|
238
|
+
|
239
|
+
return response_json
|
224
240
|
except requests.exceptions.RequestException as e:
|
225
241
|
if e.response is not None:
|
226
242
|
if e.response.status_code == 429 or e.response.status_code >= 500:
|
@@ -240,9 +256,7 @@ class AbstractOauth2Authenticator(AuthBase):
|
|
240
256
|
|
241
257
|
This method attempts to extract the access token from the provided response data.
|
242
258
|
If the access token is not found, it raises an exception indicating that the token
|
243
|
-
refresh API response was missing the access token.
|
244
|
-
it adds the token to the list of secrets to ensure it is replaced before logging
|
245
|
-
the response.
|
259
|
+
refresh API response was missing the access token.
|
246
260
|
|
247
261
|
Args:
|
248
262
|
response_data (Mapping[str, Any]): The response data from which to extract the access token.
|
@@ -257,9 +271,6 @@ class AbstractOauth2Authenticator(AuthBase):
|
|
257
271
|
raise Exception(
|
258
272
|
f"Token refresh API response was missing access token {self.get_access_token_name()}"
|
259
273
|
)
|
260
|
-
# Add the access token to the list of secrets so it is replaced before logging the response
|
261
|
-
# An argument could be made to remove the prevous access key from the list of secrets, but unmasking values seems like a security incident waiting to happen...
|
262
|
-
add_to_secrets(access_key)
|
263
274
|
except ResponseKeysMaxRecurtionReached as e:
|
264
275
|
raise e
|
265
276
|
|
@@ -90,7 +90,7 @@ airbyte_cdk/sources/declarative/concurrent_declarative_source.py,sha256=rQz9gXp3
|
|
90
90
|
airbyte_cdk/sources/declarative/datetime/__init__.py,sha256=4Hw-PX1-VgESLF16cDdvuYCzGJtHntThLF4qIiULWeo,61
|
91
91
|
airbyte_cdk/sources/declarative/datetime/datetime_parser.py,sha256=_zGNGq31RNy_0QBLt_EcTvgPyhj7urPdx6oA3M5-r3o,3150
|
92
92
|
airbyte_cdk/sources/declarative/datetime/min_max_datetime.py,sha256=0BHBtDNQZfvwM45-tY5pNlTcKAFSGGNxemoi0Jic-0E,5785
|
93
|
-
airbyte_cdk/sources/declarative/declarative_component_schema.yaml,sha256=
|
93
|
+
airbyte_cdk/sources/declarative/declarative_component_schema.yaml,sha256=eUESW1yr3OC7izK-NTtpdDxuUP0nNC2-ojxOJBjLpRw,181296
|
94
94
|
airbyte_cdk/sources/declarative/declarative_source.py,sha256=qmyMnnet92eGc3C22yBtpvD5UZjqdhsAafP_zxI5wp8,1814
|
95
95
|
airbyte_cdk/sources/declarative/declarative_stream.py,sha256=dCRlddBUSaJmBNBz1pSO1r2rTw8AP5d2_vlmIeGs2gg,10767
|
96
96
|
airbyte_cdk/sources/declarative/decoders/__init__.py,sha256=JHb_0d3SE6kNY10mxA5YBEKPeSbsWYjByq1gUQxepoE,953
|
@@ -134,14 +134,14 @@ airbyte_cdk/sources/declarative/migrations/legacy_to_per_partition_state_migrati
|
|
134
134
|
airbyte_cdk/sources/declarative/migrations/state_migration.py,sha256=KWPjealMLKSMtajXgkdGgKg7EmTLR-CqqD7UIh0-eDU,794
|
135
135
|
airbyte_cdk/sources/declarative/models/__init__.py,sha256=nUFxNCiKeYRVXuZEKA7GD-lTHxsiKcQ8FitZjKhPIvE,100
|
136
136
|
airbyte_cdk/sources/declarative/models/base_model_with_deprecations.py,sha256=Imnj3yef0aqRdLfaUxkIYISUb8YkiPrRH_wBd-x8HjM,5999
|
137
|
-
airbyte_cdk/sources/declarative/models/declarative_component_schema.py,sha256=
|
137
|
+
airbyte_cdk/sources/declarative/models/declarative_component_schema.py,sha256=ViaPosIChoR2z50_gnjFMsqW7ucWKkjxisGdZuy2-qc,127852
|
138
138
|
airbyte_cdk/sources/declarative/parsers/__init__.py,sha256=ZnqYNxHsKCgO38IwB34RQyRMXTs4GTvlRi3ImKnIioo,61
|
139
139
|
airbyte_cdk/sources/declarative/parsers/custom_code_compiler.py,sha256=nlVvHC511NUyDEEIRBkoeDTAvLqKNp-hRy8D19z8tdk,5941
|
140
140
|
airbyte_cdk/sources/declarative/parsers/custom_exceptions.py,sha256=wnRUP0Xeru9Rbu5OexXSDN9QWDo8YU4tT9M2LDVOgGA,802
|
141
141
|
airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py,sha256=2UdpCz3yi7ISZTyqkQXSSy3dMxeyOWqV7OlAS5b9GVg,11568
|
142
142
|
airbyte_cdk/sources/declarative/parsers/manifest_normalizer.py,sha256=EtKjS9c94yNp3AwQC8KUCQaAYW5T3zvFYxoWYjc_buI,19729
|
143
143
|
airbyte_cdk/sources/declarative/parsers/manifest_reference_resolver.py,sha256=pJmg78vqE5VfUrF_KJnWjucQ4k9IWFULeAxHCowrHXE,6806
|
144
|
-
airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=
|
144
|
+
airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=FYnl7J3sBA3AblWxllfn0fN2QRYfuHs2HZOZmiqgt9M,177301
|
145
145
|
airbyte_cdk/sources/declarative/partition_routers/__init__.py,sha256=TBC9AkGaUqHm2IKHMPN6punBIcY5tWGULowcLoAVkfw,1109
|
146
146
|
airbyte_cdk/sources/declarative/partition_routers/async_job_partition_router.py,sha256=VelO7zKqKtzMJ35jyFeg0ypJLQC0plqqIBNXoBW1G2E,3001
|
147
147
|
airbyte_cdk/sources/declarative/partition_routers/cartesian_product_stream_slicer.py,sha256=c5cuVFM6NFkuQqG8Z5IwkBuwDrvXZN1CunUOM_L0ezg,6892
|
@@ -166,7 +166,7 @@ airbyte_cdk/sources/declarative/requesters/error_handlers/default_http_response_
|
|
166
166
|
airbyte_cdk/sources/declarative/requesters/error_handlers/error_handler.py,sha256=Tan66odx8VHzfdyyXMQkXz2pJYksllGqvxmpoajgcK4,669
|
167
167
|
airbyte_cdk/sources/declarative/requesters/error_handlers/http_response_filter.py,sha256=E-fQbt4ShfxZVoqfnmOx69C6FUPWZz8BIqI3DN9Kcjs,7935
|
168
168
|
airbyte_cdk/sources/declarative/requesters/http_job_repository.py,sha256=pVzIDdfGs1eAZo9F6zeFYKlEmEqanhNvZLKFCHkdmNo,14348
|
169
|
-
airbyte_cdk/sources/declarative/requesters/http_requester.py,sha256=
|
169
|
+
airbyte_cdk/sources/declarative/requesters/http_requester.py,sha256=1qUqNxJ6I_4uSkW4KYXEtygVioURIEmiaDU8GMl_Jcs,18833
|
170
170
|
airbyte_cdk/sources/declarative/requesters/paginators/__init__.py,sha256=uArbKs9JKNCt7t9tZoeWwjDpyI1HoPp29FNW0JzvaEM,644
|
171
171
|
airbyte_cdk/sources/declarative/requesters/paginators/default_paginator.py,sha256=SB-Af3CRb4mJwhm4EKNxzl_PK2w5QS4tqrSNNMO2IV4,12760
|
172
172
|
airbyte_cdk/sources/declarative/requesters/paginators/no_pagination.py,sha256=b1-zKxYOUMHn7ahdWpzKEzfG4A7s_WQWy-vzRqZWzME,2152
|
@@ -348,11 +348,11 @@ airbyte_cdk/sources/streams/http/error_handlers/http_status_error_handler.py,sha
|
|
348
348
|
airbyte_cdk/sources/streams/http/error_handlers/json_error_message_parser.py,sha256=GW5rkBQLLTj7MEaDdbpG7DHxTQVRrDOg1ehLLxjqiM4,1828
|
349
349
|
airbyte_cdk/sources/streams/http/error_handlers/response_models.py,sha256=xGIVELBFY0TmH9aUq1ikoqJz8oHLr6di2JLvKWVEO-s,2236
|
350
350
|
airbyte_cdk/sources/streams/http/exceptions.py,sha256=njC7MlMJoFYcSGz4mIp6-bqLFTr6vC8ej25X0oSeyjE,1824
|
351
|
-
airbyte_cdk/sources/streams/http/http.py,sha256=
|
352
|
-
airbyte_cdk/sources/streams/http/http_client.py,sha256=
|
353
|
-
airbyte_cdk/sources/streams/http/rate_limiting.py,sha256=
|
351
|
+
airbyte_cdk/sources/streams/http/http.py,sha256=0uariNq8OFnlX7iqOHwBhecxA-Hfd5hSY8_XCEgn3jI,28499
|
352
|
+
airbyte_cdk/sources/streams/http/http_client.py,sha256=tDE0ROtxjGMVphvsw8INvGMtZ97hIF-v47pZ3jIyiwc,23011
|
353
|
+
airbyte_cdk/sources/streams/http/rate_limiting.py,sha256=IwdjrHKUnU97XO4qONgYRv4YYW51xQ8SJm4WLafXDB8,6351
|
354
354
|
airbyte_cdk/sources/streams/http/requests_native_auth/__init__.py,sha256=RN0D3nOX1xLgwEwKWu6pkGy3XqBFzKSNZ8Lf6umU2eY,413
|
355
|
-
airbyte_cdk/sources/streams/http/requests_native_auth/abstract_oauth.py,sha256=
|
355
|
+
airbyte_cdk/sources/streams/http/requests_native_auth/abstract_oauth.py,sha256=0WfnxuxDwRYeq-PIwdUjJujDnxuJPhNfHlX_8aNHtYU,19663
|
356
356
|
airbyte_cdk/sources/streams/http/requests_native_auth/abstract_token.py,sha256=Y3n7J-sk5yGjv_OxtY6Z6k0PEsFZmtIRi-x0KCbaHdA,1010
|
357
357
|
airbyte_cdk/sources/streams/http/requests_native_auth/oauth.py,sha256=gVLo7nU-ORJd413TZHMJQV4m_vaGnRqhoXGGWehFjDA,19253
|
358
358
|
airbyte_cdk/sources/streams/http/requests_native_auth/token.py,sha256=h5PTzcdH-RQLeCg7xZ45w_484OPUDSwNWl_iMJQmZoI,2526
|
@@ -424,9 +424,9 @@ airbyte_cdk/utils/slice_hasher.py,sha256=EDxgROHDbfG-QKQb59m7h_7crN1tRiawdf5uU7G
|
|
424
424
|
airbyte_cdk/utils/spec_schema_transformations.py,sha256=-5HTuNsnDBAhj-oLeQXwpTGA0HdcjFOf2zTEMUTTg_Y,816
|
425
425
|
airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
|
426
426
|
airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
|
427
|
-
airbyte_cdk-6.
|
428
|
-
airbyte_cdk-6.
|
429
|
-
airbyte_cdk-6.
|
430
|
-
airbyte_cdk-6.
|
431
|
-
airbyte_cdk-6.
|
432
|
-
airbyte_cdk-6.
|
427
|
+
airbyte_cdk-6.58.0.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
|
428
|
+
airbyte_cdk-6.58.0.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
|
429
|
+
airbyte_cdk-6.58.0.dist-info/METADATA,sha256=_BmQsFjQ5fxcJ0PPs1LNikv5PHE7ISWfsZGJJfqcLpU,6477
|
430
|
+
airbyte_cdk-6.58.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
431
|
+
airbyte_cdk-6.58.0.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
|
432
|
+
airbyte_cdk-6.58.0.dist-info/RECORD,,
|
{airbyte_cdk-6.57.3.post7.dev16093585744.dist-info → airbyte_cdk-6.58.0.dist-info}/LICENSE.txt
RENAMED
File without changes
|
{airbyte_cdk-6.57.3.post7.dev16093585744.dist-info → airbyte_cdk-6.58.0.dist-info}/LICENSE_SHORT
RENAMED
File without changes
|
File without changes
|
{airbyte_cdk-6.57.3.post7.dev16093585744.dist-info → airbyte_cdk-6.58.0.dist-info}/entry_points.txt
RENAMED
File without changes
|