airbyte-cdk 6.23.0.dev1__py3-none-any.whl → 6.24.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.
@@ -8,6 +8,7 @@ from typing import Any, List, Mapping, Optional, Union
8
8
  import requests
9
9
 
10
10
  from airbyte_cdk.sources.streams.http.error_handlers import ErrorHandler
11
+ from airbyte_cdk.sources.streams.http.error_handlers.backoff_strategy import BackoffStrategy
11
12
  from airbyte_cdk.sources.streams.http.error_handlers.response_models import (
12
13
  ErrorResolution,
13
14
  ResponseAction,
@@ -77,3 +78,24 @@ class CompositeErrorHandler(ErrorHandler):
77
78
  return matched_error_resolution
78
79
 
79
80
  return create_fallback_error_resolution(response_or_exception)
81
+
82
+ @property
83
+ def backoff_strategies(self) -> Optional[List[BackoffStrategy]]:
84
+ """
85
+ Combines backoff strategies from all child error handlers into a single flattened list.
86
+
87
+ When used with HttpRequester, note the following behavior:
88
+ - In HttpRequester.__post_init__, the entire list of backoff strategies is assigned to the error handler
89
+ - However, the error handler's backoff_time() method only ever uses the first non-None strategy in the list
90
+ - This means that if any backoff strategies are present, the first non-None strategy becomes the default
91
+ - This applies to both user-defined response filters and errors from DEFAULT_ERROR_MAPPING
92
+ - The list structure is not used to map different strategies to different error conditions
93
+ - Therefore, subsequent strategies in the list will not be used
94
+
95
+ Returns None if no handlers have strategies defined, which will result in HttpRequester using its default backoff strategy.
96
+ """
97
+ all_strategies = []
98
+ for handler in self.error_handlers:
99
+ if hasattr(handler, "backoff_strategies") and handler.backoff_strategies:
100
+ all_strategies.extend(handler.backoff_strategies)
101
+ return all_strategies if all_strategies else None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: airbyte-cdk
3
- Version: 6.23.0.dev1
3
+ Version: 6.24.0
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  License: MIT
6
6
  Keywords: airbyte,connector-development-kit,cdk
@@ -133,7 +133,7 @@ airbyte_cdk/sources/declarative/requesters/error_handlers/backoff_strategies/hea
133
133
  airbyte_cdk/sources/declarative/requesters/error_handlers/backoff_strategies/wait_time_from_header_backoff_strategy.py,sha256=I3KYCJHhPiRfxYUzOa293YH4U3wGFISDsdY1OMHWRtw,2942
134
134
  airbyte_cdk/sources/declarative/requesters/error_handlers/backoff_strategies/wait_until_time_from_header_backoff_strategy.py,sha256=T2JTIdHdPzPiW0MpkCNYPsuaHUtF9V-ijNqUqdTDl6U,3069
135
135
  airbyte_cdk/sources/declarative/requesters/error_handlers/backoff_strategy.py,sha256=ZN5kcaVAQDinX0Ld5NXA8M_7Sax5BoPsknVwH7v06as,634
136
- airbyte_cdk/sources/declarative/requesters/error_handlers/composite_error_handler.py,sha256=tw5TMrzBAixZ0Z57Y90CtBuUVYQ-V4vob74IkcBHiAQ,2745
136
+ airbyte_cdk/sources/declarative/requesters/error_handlers/composite_error_handler.py,sha256=4_PegbHBUiNbqa5ndZ2n9rm69O2iEfWU-NcIhSXZDIs,4137
137
137
  airbyte_cdk/sources/declarative/requesters/error_handlers/default_error_handler.py,sha256=BGED9TcbA3mlvd9D7sog_u5AiyjWGVOUq_00aK3PNzg,5111
138
138
  airbyte_cdk/sources/declarative/requesters/error_handlers/default_http_response_filter.py,sha256=q0YkeYUUWO6iErUy0vjqiOkhg8_9d5YcCmtlpXAJJ9E,1314
139
139
  airbyte_cdk/sources/declarative/requesters/error_handlers/error_handler.py,sha256=Tan66odx8VHzfdyyXMQkXz2pJYksllGqvxmpoajgcK4,669
@@ -350,8 +350,8 @@ airbyte_cdk/utils/slice_hasher.py,sha256=-pHexlNYoWYPnXNH-M7HEbjmeJe9Zk7SJijdQ7d
350
350
  airbyte_cdk/utils/spec_schema_transformations.py,sha256=-5HTuNsnDBAhj-oLeQXwpTGA0HdcjFOf2zTEMUTTg_Y,816
351
351
  airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
352
352
  airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
353
- airbyte_cdk-6.23.0.dev1.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
354
- airbyte_cdk-6.23.0.dev1.dist-info/METADATA,sha256=i6I1HcYKqAUk81RuehhoKF3aBClUS_KBB7r3dY7b2B8,6001
355
- airbyte_cdk-6.23.0.dev1.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
356
- airbyte_cdk-6.23.0.dev1.dist-info/entry_points.txt,sha256=fj-e3PAQvsxsQzyyq8UkG1k8spunWnD4BAH2AwlR6NM,95
357
- airbyte_cdk-6.23.0.dev1.dist-info/RECORD,,
353
+ airbyte_cdk-6.24.0.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
354
+ airbyte_cdk-6.24.0.dist-info/METADATA,sha256=gcB9n4UhfAWvPJeJDJY-vyNJxyT0UAZuo56MblawtYo,5996
355
+ airbyte_cdk-6.24.0.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
356
+ airbyte_cdk-6.24.0.dist-info/entry_points.txt,sha256=fj-e3PAQvsxsQzyyq8UkG1k8spunWnD4BAH2AwlR6NM,95
357
+ airbyte_cdk-6.24.0.dist-info/RECORD,,