airbyte-cdk 6.49.1__py3-none-any.whl → 6.50.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.
@@ -2318,6 +2318,12 @@ definitions:
2318
2318
  - "$ref": "#/definitions/AsyncRetriever"
2319
2319
  - "$ref": "#/definitions/CustomRetriever"
2320
2320
  - "$ref": "#/definitions/SimpleRetriever"
2321
+ schema_filter:
2322
+ title: Schema Filter
2323
+ description: Responsible for filtering fields to be added to json schema.
2324
+ anyOf:
2325
+ - "$ref": "#/definitions/RecordFilter"
2326
+ - "$ref": "#/definitions/CustomRecordFilter"
2321
2327
  schema_transformations:
2322
2328
  title: Schema Transformations
2323
2329
  description: A list of transformations to be applied to the schema.
@@ -1,5 +1,3 @@
1
- # Copyright (c) 2025 Airbyte, Inc., all rights reserved.
2
-
3
1
  # generated by datamodel-codegen:
4
2
  # filename: declarative_component_schema.yaml
5
3
 
@@ -2582,6 +2580,11 @@ class DynamicSchemaLoader(BaseModel):
2582
2580
  description="Component used to coordinate how records are extracted across stream slices and request pages.",
2583
2581
  title="Retriever",
2584
2582
  )
2583
+ schema_filter: Optional[Union[RecordFilter, CustomRecordFilter]] = Field(
2584
+ None,
2585
+ description="Responsible for filtering fields to be added to json schema.",
2586
+ title="Schema Filter",
2587
+ )
2585
2588
  schema_transformations: Optional[
2586
2589
  List[
2587
2590
  Union[
@@ -2544,10 +2544,19 @@ class ModelToComponentFactory:
2544
2544
  schema_type_identifier = self._create_component_from_model(
2545
2545
  model.schema_type_identifier, config=config, parameters=model.parameters or {}
2546
2546
  )
2547
+ schema_filter = (
2548
+ self._create_component_from_model(
2549
+ model.schema_filter, config=config, parameters=model.parameters or {}
2550
+ )
2551
+ if model.schema_filter is not None
2552
+ else None
2553
+ )
2554
+
2547
2555
  return DynamicSchemaLoader(
2548
2556
  retriever=retriever,
2549
2557
  config=config,
2550
2558
  schema_transformations=schema_transformations,
2559
+ schema_filter=schema_filter,
2551
2560
  schema_type_identifier=schema_type_identifier,
2552
2561
  parameters=model.parameters or {},
2553
2562
  )
@@ -10,6 +10,7 @@ from typing import Any, List, Mapping, MutableMapping, Optional, Union
10
10
  import dpath
11
11
  from typing_extensions import deprecated
12
12
 
13
+ from airbyte_cdk.sources.declarative.extractors.record_filter import RecordFilter
13
14
  from airbyte_cdk.sources.declarative.interpolation.interpolated_boolean import InterpolatedBoolean
14
15
  from airbyte_cdk.sources.declarative.interpolation.interpolated_string import InterpolatedString
15
16
  from airbyte_cdk.sources.declarative.retrievers.retriever import Retriever
@@ -126,6 +127,7 @@ class DynamicSchemaLoader(SchemaLoader):
126
127
  parameters: InitVar[Mapping[str, Any]]
127
128
  schema_type_identifier: SchemaTypeIdentifier
128
129
  schema_transformations: List[RecordTransformation] = field(default_factory=lambda: [])
130
+ schema_filter: Optional[RecordFilter] = None
129
131
 
130
132
  def get_json_schema(self) -> Mapping[str, Any]:
131
133
  """
@@ -151,20 +153,18 @@ class DynamicSchemaLoader(SchemaLoader):
151
153
  )
152
154
  properties[key] = value
153
155
 
154
- transformed_properties = self._transform(properties, {})
156
+ filtered_transformed_properties = self._transform(self._filter(properties))
155
157
 
156
158
  return {
157
159
  "$schema": "https://json-schema.org/draft-07/schema#",
158
160
  "type": "object",
159
161
  "additionalProperties": True,
160
- "properties": transformed_properties,
162
+ "properties": filtered_transformed_properties,
161
163
  }
162
164
 
163
165
  def _transform(
164
166
  self,
165
167
  properties: Mapping[str, Any],
166
- stream_state: StreamState,
167
- stream_slice: Optional[StreamSlice] = None,
168
168
  ) -> Mapping[str, Any]:
169
169
  for transformation in self.schema_transformations:
170
170
  transformation.transform(
@@ -173,6 +173,21 @@ class DynamicSchemaLoader(SchemaLoader):
173
173
  )
174
174
  return properties
175
175
 
176
+ def _filter(
177
+ self,
178
+ properties: Mapping[str, Any],
179
+ ) -> Mapping[str, Any]:
180
+ if not self.schema_filter:
181
+ return properties
182
+
183
+ filtered_properties: MutableMapping[str, Any] = {}
184
+ for item in self.schema_filter.filter_records(
185
+ ({k: v} for k, v in properties.items()),
186
+ {},
187
+ ):
188
+ filtered_properties.update(item)
189
+ return filtered_properties
190
+
176
191
  def _get_key(
177
192
  self,
178
193
  raw_schema: MutableMapping[str, Any],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 6.49.1
3
+ Version: 6.50.0
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -89,7 +89,7 @@ airbyte_cdk/sources/declarative/concurrent_declarative_source.py,sha256=GoZJ8Oxb
89
89
  airbyte_cdk/sources/declarative/datetime/__init__.py,sha256=4Hw-PX1-VgESLF16cDdvuYCzGJtHntThLF4qIiULWeo,61
90
90
  airbyte_cdk/sources/declarative/datetime/datetime_parser.py,sha256=_zGNGq31RNy_0QBLt_EcTvgPyhj7urPdx6oA3M5-r3o,3150
91
91
  airbyte_cdk/sources/declarative/datetime/min_max_datetime.py,sha256=0BHBtDNQZfvwM45-tY5pNlTcKAFSGGNxemoi0Jic-0E,5785
92
- airbyte_cdk/sources/declarative/declarative_component_schema.yaml,sha256=7zAyt65WXfuCINtJde1abqGkR8aumQi6y3TM4BDKKxg,176415
92
+ airbyte_cdk/sources/declarative/declarative_component_schema.yaml,sha256=ttq2s4aivIbvIj2OWy0-CNb2cVXYVTzOgXS9PLbMNWU,176666
93
93
  airbyte_cdk/sources/declarative/declarative_source.py,sha256=qmyMnnet92eGc3C22yBtpvD5UZjqdhsAafP_zxI5wp8,1814
94
94
  airbyte_cdk/sources/declarative/declarative_stream.py,sha256=dCRlddBUSaJmBNBz1pSO1r2rTw8AP5d2_vlmIeGs2gg,10767
95
95
  airbyte_cdk/sources/declarative/decoders/__init__.py,sha256=JHb_0d3SE6kNY10mxA5YBEKPeSbsWYjByq1gUQxepoE,953
@@ -133,14 +133,14 @@ airbyte_cdk/sources/declarative/migrations/legacy_to_per_partition_state_migrati
133
133
  airbyte_cdk/sources/declarative/migrations/state_migration.py,sha256=KWPjealMLKSMtajXgkdGgKg7EmTLR-CqqD7UIh0-eDU,794
134
134
  airbyte_cdk/sources/declarative/models/__init__.py,sha256=nUFxNCiKeYRVXuZEKA7GD-lTHxsiKcQ8FitZjKhPIvE,100
135
135
  airbyte_cdk/sources/declarative/models/base_model_with_deprecations.py,sha256=Imnj3yef0aqRdLfaUxkIYISUb8YkiPrRH_wBd-x8HjM,5999
136
- airbyte_cdk/sources/declarative/models/declarative_component_schema.py,sha256=TCOXpf0qIifpQVmRPYt6k21yxuvY1KoYwAA-74tSB2M,124968
136
+ airbyte_cdk/sources/declarative/models/declarative_component_schema.py,sha256=YhQl_vjQyWl1GJTuPyhg1aKWQazbqHROZ5v0dIg7auE,125123
137
137
  airbyte_cdk/sources/declarative/parsers/__init__.py,sha256=ZnqYNxHsKCgO38IwB34RQyRMXTs4GTvlRi3ImKnIioo,61
138
138
  airbyte_cdk/sources/declarative/parsers/custom_code_compiler.py,sha256=nlVvHC511NUyDEEIRBkoeDTAvLqKNp-hRy8D19z8tdk,5941
139
139
  airbyte_cdk/sources/declarative/parsers/custom_exceptions.py,sha256=wnRUP0Xeru9Rbu5OexXSDN9QWDo8YU4tT9M2LDVOgGA,802
140
140
  airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py,sha256=2UdpCz3yi7ISZTyqkQXSSy3dMxeyOWqV7OlAS5b9GVg,11568
141
141
  airbyte_cdk/sources/declarative/parsers/manifest_normalizer.py,sha256=laBy7ebjA-PiNwc-50U4FHvMqS_mmHvnabxgFs4CjGw,17069
142
142
  airbyte_cdk/sources/declarative/parsers/manifest_reference_resolver.py,sha256=pJmg78vqE5VfUrF_KJnWjucQ4k9IWFULeAxHCowrHXE,6806
143
- airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=60w0FR8iU4O4J-HdE7bMRYD7TXuCO4MgXLah1_4GX2Q,174107
143
+ airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=j7MUNaWDpsxe5yDzE3-id_wivjNrSjsJa1VgE4oSRlo,174401
144
144
  airbyte_cdk/sources/declarative/partition_routers/__init__.py,sha256=TBC9AkGaUqHm2IKHMPN6punBIcY5tWGULowcLoAVkfw,1109
145
145
  airbyte_cdk/sources/declarative/partition_routers/async_job_partition_router.py,sha256=VelO7zKqKtzMJ35jyFeg0ypJLQC0plqqIBNXoBW1G2E,3001
146
146
  airbyte_cdk/sources/declarative/partition_routers/cartesian_product_stream_slicer.py,sha256=c5cuVFM6NFkuQqG8Z5IwkBuwDrvXZN1CunUOM_L0ezg,6892
@@ -211,7 +211,7 @@ airbyte_cdk/sources/declarative/retrievers/simple_retriever.py,sha256=Ui7V_etQ-s
211
211
  airbyte_cdk/sources/declarative/schema/__init__.py,sha256=xU45UvM5O4c1PSM13UHpCdh5hpW3HXy9vRRGEiAC1rg,795
212
212
  airbyte_cdk/sources/declarative/schema/composite_schema_loader.py,sha256=ymGbvxS_QyGc4nnjEyRo5ch8bVedELO41PAUxKXZyMw,1113
213
213
  airbyte_cdk/sources/declarative/schema/default_schema_loader.py,sha256=UnbzlExmwoQiVV8zDg4lhAEaqA_0pRfwbMRe8yqOuWk,1834
214
- airbyte_cdk/sources/declarative/schema/dynamic_schema_loader.py,sha256=J8Q_iJYhcSQLWyt0bTZCbDAGpxt9G8FCc6Q9jtGsNzw,10703
214
+ airbyte_cdk/sources/declarative/schema/dynamic_schema_loader.py,sha256=QJsEcwJcRQai3nCE0NQwZ18U2mvwGsVH2rF_TSrfzpE,11214
215
215
  airbyte_cdk/sources/declarative/schema/inline_schema_loader.py,sha256=bVETE10hRsatRJq3R3BeyRR0wIoK3gcP1gcpVRQ_P5U,464
216
216
  airbyte_cdk/sources/declarative/schema/json_file_schema_loader.py,sha256=5Wl-fqW-pVf_dxJ4yGHMAFfC4JjKHYJhqFJT1xA57F4,4177
217
217
  airbyte_cdk/sources/declarative/schema/schema_loader.py,sha256=kjt8v0N5wWKA5zyLnrDLxf1PJKdUqvQq2RVnAOAzNSY,379
@@ -419,9 +419,9 @@ airbyte_cdk/utils/slice_hasher.py,sha256=EDxgROHDbfG-QKQb59m7h_7crN1tRiawdf5uU7G
419
419
  airbyte_cdk/utils/spec_schema_transformations.py,sha256=-5HTuNsnDBAhj-oLeQXwpTGA0HdcjFOf2zTEMUTTg_Y,816
420
420
  airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
421
421
  airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
422
- airbyte_cdk-6.49.1.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
423
- airbyte_cdk-6.49.1.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
424
- airbyte_cdk-6.49.1.dist-info/METADATA,sha256=ouUIXpKqnriWOr3CaJ1UegcZpoMWWaUVu6BnqCoSsfE,6343
425
- airbyte_cdk-6.49.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
426
- airbyte_cdk-6.49.1.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
427
- airbyte_cdk-6.49.1.dist-info/RECORD,,
422
+ airbyte_cdk-6.50.0.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
423
+ airbyte_cdk-6.50.0.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
424
+ airbyte_cdk-6.50.0.dist-info/METADATA,sha256=f8KKwJtpEpfmbpMDfbO4gBZRuNEp95A3YNHSrza7nkM,6343
425
+ airbyte_cdk-6.50.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
426
+ airbyte_cdk-6.50.0.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
427
+ airbyte_cdk-6.50.0.dist-info/RECORD,,