airbyte-cdk 6.57.3.post2.dev16088474497__py3-none-any.whl → 6.57.3.post7.dev16093585744__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.
@@ -473,6 +473,7 @@ class HttpRequester(Requester):
473
473
  dedupe_query_params=True,
474
474
  log_formatter=log_formatter,
475
475
  exit_on_rate_limit=self._exit_on_rate_limit,
476
+ stream_slice=stream_slice,
476
477
  )
477
478
 
478
479
  return response
@@ -546,6 +546,7 @@ class HttpStream(Stream, CheckpointMixin, ABC):
546
546
  dedupe_query_params=True,
547
547
  log_formatter=self.get_log_formatter(),
548
548
  exit_on_rate_limit=self.exit_on_rate_limit,
549
+ stream_slice=stream_slice,
549
550
  )
550
551
 
551
552
  return request, response
@@ -243,6 +243,7 @@ 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,
246
247
  ) -> requests.Response:
247
248
  """
248
249
  Sends a request with retry logic.
@@ -259,9 +260,9 @@ class HttpClient:
259
260
  max_tries = max(0, max_retries) + 1
260
261
  max_time = self._max_time
261
262
 
262
- user_backoff_handler = user_defined_backoff_handler(max_tries=max_tries, max_time=max_time, request_url=request.url)(
263
- self._send
264
- )
263
+ user_backoff_handler = user_defined_backoff_handler(
264
+ max_tries=max_tries, max_time=max_time, stream_slice=stream_slice
265
+ )(self._send)
265
266
  rate_limit_backoff_handler = rate_limit_default_backoff_handler(max_tries=max_tries)
266
267
  backoff_handler = http_client_default_backoff_handler(
267
268
  max_tries=max_tries, max_time=max_time
@@ -506,6 +507,7 @@ class HttpClient:
506
507
  dedupe_query_params: bool = False,
507
508
  log_formatter: Optional[Callable[[requests.Response], Any]] = None,
508
509
  exit_on_rate_limit: Optional[bool] = False,
510
+ stream_slice: Optional[Mapping[str, Any]] = None,
509
511
  ) -> Tuple[requests.PreparedRequest, requests.Response]:
510
512
  """
511
513
  Prepares and sends request and return request and response objects.
@@ -526,6 +528,7 @@ class HttpClient:
526
528
  request_kwargs=request_kwargs,
527
529
  log_formatter=log_formatter,
528
530
  exit_on_rate_limit=exit_on_rate_limit,
531
+ stream_slice=stream_slice,
529
532
  )
530
533
 
531
534
  return request, response
@@ -101,7 +101,10 @@ def http_client_default_backoff_handler(
101
101
 
102
102
 
103
103
  def user_defined_backoff_handler(
104
- max_tries: Optional[int], max_time: Optional[int] = None, request_url: Optional[str] = None, **kwargs: Any
104
+ max_tries: Optional[int],
105
+ max_time: Optional[int] = None,
106
+ stream_slice: Optional[Mapping[str, Any]] = None,
107
+ **kwargs: Any,
105
108
  ) -> Callable[[SendRequestCallableType], SendRequestCallableType]:
106
109
  def sleep_on_ratelimit(details: Mapping[str, Any]) -> None:
107
110
  _, exc, _ = sys.exc_info()
@@ -112,7 +115,10 @@ def user_defined_backoff_handler(
112
115
  )
113
116
  retry_after = exc.backoff
114
117
  # include logging og the current time to help with debugging
115
- logger.info(f"Retrying. Sleeping for {retry_after} seconds at {time.strftime('%Y-%m-%d %H:%M:%S')} for URL: {request_url or 'unknown'}")
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)
116
122
  time.sleep(retry_after + 1) # extra second to cover any fractions of second
117
123
 
118
124
  def log_give_up(details: Mapping[str, Any]) -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 6.57.3.post2.dev16088474497
3
+ Version: 6.57.3.post7.dev16093585744
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -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=1qUqNxJ6I_4uSkW4KYXEtygVioURIEmiaDU8GMl_Jcs,18833
169
+ airbyte_cdk/sources/declarative/requesters/http_requester.py,sha256=3CaEtPT8lsMwH9t8NTXL9KMY2hPIH_h6ntnwMC1Hvuk,18872
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,9 +348,9 @@ 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=0uariNq8OFnlX7iqOHwBhecxA-Hfd5hSY8_XCEgn3jI,28499
352
- airbyte_cdk/sources/streams/http/http_client.py,sha256=zLt4hAkkm5VyD5aRoZ69DESN-HG6zYmfccIxXzBY8Z0,23036
353
- airbyte_cdk/sources/streams/http/rate_limiting.py,sha256=aAjGpRjbeAYGzUif8lLo7oDL-B2UmlN2UFPcsGtpdw8,6535
351
+ airbyte_cdk/sources/streams/http/http.py,sha256=qoAt-FPYw5bSo8-OIJMV1_GtcCBCKgY9gR_xdOGUWbU,28538
352
+ airbyte_cdk/sources/streams/http/http_client.py,sha256=iGTcrjSyNLR5o9XiHGgEVhL5qZWSB0XbuZXDX8liS1g,23193
353
+ airbyte_cdk/sources/streams/http/rate_limiting.py,sha256=qrbM5ZmBLYt5PD68I5YXilCJgUtv_FgfUylAUqtElcc,6667
354
354
  airbyte_cdk/sources/streams/http/requests_native_auth/__init__.py,sha256=RN0D3nOX1xLgwEwKWu6pkGy3XqBFzKSNZ8Lf6umU2eY,413
355
355
  airbyte_cdk/sources/streams/http/requests_native_auth/abstract_oauth.py,sha256=2vLa1zMWxIfaj5iLi404Y2YCgC0uDhRCJCvXDwcFBys,19569
356
356
  airbyte_cdk/sources/streams/http/requests_native_auth/abstract_token.py,sha256=Y3n7J-sk5yGjv_OxtY6Z6k0PEsFZmtIRi-x0KCbaHdA,1010
@@ -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.57.3.post2.dev16088474497.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
428
- airbyte_cdk-6.57.3.post2.dev16088474497.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
429
- airbyte_cdk-6.57.3.post2.dev16088474497.dist-info/METADATA,sha256=nggEcxpdGIFBdk5Vbn8bs__1S4zJ4joaPgEYbVYvwbY,6498
430
- airbyte_cdk-6.57.3.post2.dev16088474497.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
431
- airbyte_cdk-6.57.3.post2.dev16088474497.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
432
- airbyte_cdk-6.57.3.post2.dev16088474497.dist-info/RECORD,,
427
+ airbyte_cdk-6.57.3.post7.dev16093585744.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
428
+ airbyte_cdk-6.57.3.post7.dev16093585744.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
429
+ airbyte_cdk-6.57.3.post7.dev16093585744.dist-info/METADATA,sha256=7uBnctJ5MnEaHlGeM2cDSVL0YwKgSvmMR44eez5ozNw,6498
430
+ airbyte_cdk-6.57.3.post7.dev16093585744.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
431
+ airbyte_cdk-6.57.3.post7.dev16093585744.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
432
+ airbyte_cdk-6.57.3.post7.dev16093585744.dist-info/RECORD,,