airbyte-cdk 6.28.0__py3-none-any.whl → 6.29.0.dev0__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.
@@ -23,6 +23,7 @@ class CheckDynamicStream(ConnectionChecker):
23
23
 
24
24
  stream_count: int
25
25
  parameters: InitVar[Mapping[str, Any]]
26
+ use_check_availability: bool = True
26
27
 
27
28
  def __post_init__(self, parameters: Mapping[str, Any]) -> None:
28
29
  self._parameters = parameters
@@ -31,21 +32,27 @@ class CheckDynamicStream(ConnectionChecker):
31
32
  self, source: AbstractSource, logger: logging.Logger, config: Mapping[str, Any]
32
33
  ) -> Tuple[bool, Any]:
33
34
  streams = source.streams(config=config)
35
+
34
36
  if len(streams) == 0:
35
37
  return False, f"No streams to connect to from source {source}"
38
+ if not self.use_check_availability:
39
+ return True, None
40
+
41
+ availability_strategy = HttpAvailabilityStrategy()
36
42
 
37
- for stream_index in range(min(self.stream_count, len(streams))):
38
- stream = streams[stream_index]
39
- availability_strategy = HttpAvailabilityStrategy()
40
- try:
43
+ try:
44
+ for stream in streams[: min(self.stream_count, len(streams))]:
41
45
  stream_is_available, reason = availability_strategy.check_availability(
42
46
  stream, logger
43
47
  )
44
48
  if not stream_is_available:
49
+ logger.warning(f"Stream {stream.name} is not available: {reason}")
45
50
  return False, reason
46
- except Exception as error:
47
- logger.error(
48
- f"Encountered an error trying to connect to stream {stream.name}. Error: \n {traceback.format_exc()}"
49
- )
50
- return False, f"Unable to connect to stream {stream.name} - {error}"
51
+ except Exception as error:
52
+ error_message = (
53
+ f"Encountered an error trying to connect to stream {stream.name}. Error: {error}"
54
+ )
55
+ logger.error(error_message, exc_info=True)
56
+ return False, error_message
57
+
51
58
  return True, None
@@ -320,6 +320,11 @@ definitions:
320
320
  title: Stream Count
321
321
  description: Numbers of the streams to try reading from when running a check operation.
322
322
  type: integer
323
+ use_check_availability:
324
+ title: Use Check Availability
325
+ description: Enables stream check availability. This field is automatically set by the CDK.
326
+ type: boolean
327
+ default: true
323
328
  CompositeErrorHandler:
324
329
  title: Composite Error Handler
325
330
  description: Error handler that sequentially iterates over a list of error handlers.
@@ -59,6 +59,11 @@ class CheckDynamicStream(BaseModel):
59
59
  description="Numbers of the streams to try reading from when running a check operation.",
60
60
  title="Stream Count",
61
61
  )
62
+ use_check_availability: Optional[bool] = Field(
63
+ True,
64
+ description="Enables stream check availability. This field is automatically set by the CDK.",
65
+ title="Use Check Availability",
66
+ )
62
67
 
63
68
 
64
69
  class ConcurrencyLevel(BaseModel):
@@ -903,7 +903,15 @@ class ModelToComponentFactory:
903
903
  def create_check_dynamic_stream(
904
904
  model: CheckDynamicStreamModel, config: Config, **kwargs: Any
905
905
  ) -> CheckDynamicStream:
906
- return CheckDynamicStream(stream_count=model.stream_count, parameters={})
906
+ assert model.use_check_availability is not None # for mypy
907
+
908
+ use_check_availability = model.use_check_availability
909
+
910
+ return CheckDynamicStream(
911
+ stream_count=model.stream_count,
912
+ use_check_availability=use_check_availability,
913
+ parameters={},
914
+ )
907
915
 
908
916
  def create_composite_error_handler(
909
917
  self, model: CompositeErrorHandlerModel, config: Config, **kwargs: Any
@@ -151,16 +151,16 @@ class HttpResponseFilter:
151
151
  :param response: The HTTP response which can be used during interpolation
152
152
  :return: The evaluated error message string to be emitted
153
153
  """
154
- return self.error_message.eval( # type: ignore [no-any-return, union-attr]
154
+ return self.error_message.eval( # type: ignore[no-any-return, union-attr]
155
155
  self.config, response=self._safe_response_json(response), headers=response.headers
156
156
  )
157
157
 
158
158
  def _response_matches_predicate(self, response: requests.Response) -> bool:
159
159
  return (
160
160
  bool(
161
- self.predicate.condition # type: ignore [union-attr]
162
- and self.predicate.eval( # type: ignore [union-attr]
163
- None, # type: ignore [arg-type]
161
+ self.predicate.condition # type:ignore[union-attr]
162
+ and self.predicate.eval( # type:ignore[union-attr]
163
+ None, # type: ignore[arg-type]
164
164
  response=self._safe_response_json(response),
165
165
  headers=response.headers,
166
166
  )
@@ -225,6 +225,7 @@ class DynamicSchemaLoader(SchemaLoader):
225
225
  return self._get_airbyte_type(complex_type.field_type)
226
226
 
227
227
  field_type = self._get_airbyte_type(complex_type.field_type)
228
+
228
229
  field_type["items"] = (
229
230
  self._get_airbyte_type(complex_type.items)
230
231
  if isinstance(complex_type.items, str)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 6.28.0
3
+ Version: 6.29.0.dev0
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -58,7 +58,7 @@ airbyte_cdk/sources/declarative/auth/selective_authenticator.py,sha256=qGwC6YsCl
58
58
  airbyte_cdk/sources/declarative/auth/token.py,sha256=r4u3WXyVa7WmiSZ9-eZXlrUI-pS0D4YWJnwjLzwV-Fk,11210
59
59
  airbyte_cdk/sources/declarative/auth/token_provider.py,sha256=9CuSsmOoHkvlc4k-oZ3Jx5luAgfTMm1I_5HOZxw7wMU,3075
60
60
  airbyte_cdk/sources/declarative/checks/__init__.py,sha256=nsVV5Bo0E_tBNd8A4Xdsdb-75PpcLo5RQu2RQ_Gv-ME,806
61
- airbyte_cdk/sources/declarative/checks/check_dynamic_stream.py,sha256=aXKL1YSAB-0T_eZiavb7e5rprf-DdXG77Fy81FtlcWk,1843
61
+ airbyte_cdk/sources/declarative/checks/check_dynamic_stream.py,sha256=AiEcloWKAQYLKCCBy9a_lGFToBp3Pvo8mgrVMictfPs,1976
62
62
  airbyte_cdk/sources/declarative/checks/check_stream.py,sha256=dAA-UhmMj0WLXCkRQrilWCfJmncBzXCZ18ptRNip3XA,2139
63
63
  airbyte_cdk/sources/declarative/checks/connection_checker.py,sha256=MBRJo6WJlZQHpIfOGaNOkkHUmgUl_4wDM6VPo41z5Ss,1383
64
64
  airbyte_cdk/sources/declarative/concurrency_level/__init__.py,sha256=5XUqrmlstYlMM0j6crktlKQwALek0uiz2D3WdM46MyA,191
@@ -67,7 +67,7 @@ airbyte_cdk/sources/declarative/concurrent_declarative_source.py,sha256=uhSXYhXD
67
67
  airbyte_cdk/sources/declarative/datetime/__init__.py,sha256=l9LG7Qm6e5r_qgqfVKnx3mXYtg1I9MmMjomVIPfU4XA,177
68
68
  airbyte_cdk/sources/declarative/datetime/datetime_parser.py,sha256=SX9JjdesN1edN2WVUVMzU_ptqp2QB1OnsnjZ4mwcX7w,2579
69
69
  airbyte_cdk/sources/declarative/datetime/min_max_datetime.py,sha256=0BHBtDNQZfvwM45-tY5pNlTcKAFSGGNxemoi0Jic-0E,5785
70
- airbyte_cdk/sources/declarative/declarative_component_schema.yaml,sha256=yHOfjvrxDVnQmMi-mrdM27Y0Uqk4fYMmp9Rwdbq6-7s,139662
70
+ airbyte_cdk/sources/declarative/declarative_component_schema.yaml,sha256=43cBrshQer-KiNwjlA6peDyfrST88VQIZmfgdAZTiLc,139874
71
71
  airbyte_cdk/sources/declarative/declarative_source.py,sha256=nF7wBqFd3AQmEKAm4CnIo29CJoQL562cJGSCeL8U8bA,1531
72
72
  airbyte_cdk/sources/declarative/declarative_stream.py,sha256=JRyNeOIpsFu4ztVZsN6sncqUEIqIE-bUkD2TPgbMgk0,10375
73
73
  airbyte_cdk/sources/declarative/decoders/__init__.py,sha256=KSpQetKGqPCv-38QgcVJ5kzM5nzbFldTSsYDCS3Xf0Y,1035
@@ -109,13 +109,13 @@ airbyte_cdk/sources/declarative/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW
109
109
  airbyte_cdk/sources/declarative/migrations/legacy_to_per_partition_state_migration.py,sha256=iemy3fKLczcU0-Aor7tx5jcT6DRedKMqyK7kCOp01hg,3924
110
110
  airbyte_cdk/sources/declarative/migrations/state_migration.py,sha256=KWPjealMLKSMtajXgkdGgKg7EmTLR-CqqD7UIh0-eDU,794
111
111
  airbyte_cdk/sources/declarative/models/__init__.py,sha256=nUFxNCiKeYRVXuZEKA7GD-lTHxsiKcQ8FitZjKhPIvE,100
112
- airbyte_cdk/sources/declarative/models/declarative_component_schema.py,sha256=68JPw6bLHnTh7zGN3CC8B6b9NI4hxvSPOyLyY8TVRqk,98059
112
+ airbyte_cdk/sources/declarative/models/declarative_component_schema.py,sha256=UJ9sYWqoohaT0mr0ALxOP74t0TTJRhfZMHBoqViaoVU,98273
113
113
  airbyte_cdk/sources/declarative/parsers/__init__.py,sha256=ZnqYNxHsKCgO38IwB34RQyRMXTs4GTvlRi3ImKnIioo,61
114
114
  airbyte_cdk/sources/declarative/parsers/custom_code_compiler.py,sha256=958MMX6_ZOJUlDDdNr9Krosgi2bCKGx2Z765M2Woz18,5505
115
115
  airbyte_cdk/sources/declarative/parsers/custom_exceptions.py,sha256=Rir9_z3Kcd5Es0-LChrzk-0qubAsiK_RSEnLmK2OXm8,553
116
116
  airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py,sha256=CXwTfD3wSQq3okcqwigpprbHhSURUokh4GK2OmOyKC8,9132
117
117
  airbyte_cdk/sources/declarative/parsers/manifest_reference_resolver.py,sha256=IWUOdF03o-aQn0Occo1BJCxU0Pz-QILk5L67nzw2thw,6803
118
- airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=zo1FbRgLL-wA7O0rpyJ7IaRkQ6OhyP6Lq4KZGqU4ijw,125265
118
+ airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=y4Yd9ik37vUkN3Jw54BkcCYv4UAT0QtBLfwtqPxDPYc,125491
119
119
  airbyte_cdk/sources/declarative/partition_routers/__init__.py,sha256=HJ-Syp3p7RpyR_OK0X_a2kSyISfu3W-PKrRI16iY0a8,957
120
120
  airbyte_cdk/sources/declarative/partition_routers/async_job_partition_router.py,sha256=n82J15S8bjeMZ5uROu--P3hnbQoxkY5v7RPHYx7g7ro,2929
121
121
  airbyte_cdk/sources/declarative/partition_routers/cartesian_product_stream_slicer.py,sha256=c5cuVFM6NFkuQqG8Z5IwkBuwDrvXZN1CunUOM_L0ezg,6892
@@ -137,7 +137,7 @@ airbyte_cdk/sources/declarative/requesters/error_handlers/composite_error_handle
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
140
- airbyte_cdk/sources/declarative/requesters/error_handlers/http_response_filter.py,sha256=vhWsEKNTYEzZ4gerhHqnDNKu4wGIP485NAzpSQ5DRZg,7941
140
+ airbyte_cdk/sources/declarative/requesters/error_handlers/http_response_filter.py,sha256=E-fQbt4ShfxZVoqfnmOx69C6FUPWZz8BIqI3DN9Kcjs,7935
141
141
  airbyte_cdk/sources/declarative/requesters/http_job_repository.py,sha256=3GtOefPH08evlSUxaILkiKLTHbIspFY4qd5B3ZqNE60,10063
142
142
  airbyte_cdk/sources/declarative/requesters/http_requester.py,sha256=RqYPkgJFAWfcZBTc-JBcGHPm4JL1ZQOhs9GKU4MP2eE,14723
143
143
  airbyte_cdk/sources/declarative/requesters/paginators/__init__.py,sha256=uArbKs9JKNCt7t9tZoeWwjDpyI1HoPp29FNW0JzvaEM,644
@@ -170,7 +170,7 @@ airbyte_cdk/sources/declarative/retrievers/retriever.py,sha256=XPLs593Xv8c5cKMc3
170
170
  airbyte_cdk/sources/declarative/retrievers/simple_retriever.py,sha256=kgnhVQxRlFqJs2-rDu2-QH-p-GzQU3nKmSp6_aq8u0s,24550
171
171
  airbyte_cdk/sources/declarative/schema/__init__.py,sha256=xU45UvM5O4c1PSM13UHpCdh5hpW3HXy9vRRGEiAC1rg,795
172
172
  airbyte_cdk/sources/declarative/schema/default_schema_loader.py,sha256=KTACrIE23a83wsm3Rd9Eb4K6-20lrGqYxTHNp9yxsso,1820
173
- airbyte_cdk/sources/declarative/schema/dynamic_schema_loader.py,sha256=d8tfDiDcJiunvN_Yalyfx5ISY5A-iIW3HbPwX2Hagh4,10702
173
+ airbyte_cdk/sources/declarative/schema/dynamic_schema_loader.py,sha256=J8Q_iJYhcSQLWyt0bTZCbDAGpxt9G8FCc6Q9jtGsNzw,10703
174
174
  airbyte_cdk/sources/declarative/schema/inline_schema_loader.py,sha256=bVETE10hRsatRJq3R3BeyRR0wIoK3gcP1gcpVRQ_P5U,464
175
175
  airbyte_cdk/sources/declarative/schema/json_file_schema_loader.py,sha256=5Wl-fqW-pVf_dxJ4yGHMAFfC4JjKHYJhqFJT1xA57F4,4177
176
176
  airbyte_cdk/sources/declarative/schema/schema_loader.py,sha256=kjt8v0N5wWKA5zyLnrDLxf1PJKdUqvQq2RVnAOAzNSY,379
@@ -351,9 +351,9 @@ airbyte_cdk/utils/slice_hasher.py,sha256=EDxgROHDbfG-QKQb59m7h_7crN1tRiawdf5uU7G
351
351
  airbyte_cdk/utils/spec_schema_transformations.py,sha256=-5HTuNsnDBAhj-oLeQXwpTGA0HdcjFOf2zTEMUTTg_Y,816
352
352
  airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
353
353
  airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
354
- airbyte_cdk-6.28.0.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
355
- airbyte_cdk-6.28.0.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
356
- airbyte_cdk-6.28.0.dist-info/METADATA,sha256=EYHArwfUWLBPhnr-8IYPz0Vhh8cA3Nx5BKznR26QB2g,6010
357
- airbyte_cdk-6.28.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
358
- airbyte_cdk-6.28.0.dist-info/entry_points.txt,sha256=fj-e3PAQvsxsQzyyq8UkG1k8spunWnD4BAH2AwlR6NM,95
359
- airbyte_cdk-6.28.0.dist-info/RECORD,,
354
+ airbyte_cdk-6.29.0.dev0.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
355
+ airbyte_cdk-6.29.0.dev0.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
356
+ airbyte_cdk-6.29.0.dev0.dist-info/METADATA,sha256=n7QmjRDxU46sb7iJo6tyHtaMQH-Dbzd1Z-MQO3RFsEQ,6015
357
+ airbyte_cdk-6.29.0.dev0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
358
+ airbyte_cdk-6.29.0.dev0.dist-info/entry_points.txt,sha256=fj-e3PAQvsxsQzyyq8UkG1k8spunWnD4BAH2AwlR6NM,95
359
+ airbyte_cdk-6.29.0.dev0.dist-info/RECORD,,