airbyte-cdk 6.47.2__py3-none-any.whl → 6.48.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.
@@ -1464,7 +1464,7 @@ definitions:
1464
1464
  properties:
1465
1465
  type:
1466
1466
  type: string
1467
- enum: [ FileUploader ]
1467
+ enum: [FileUploader]
1468
1468
  requester:
1469
1469
  description: Requester component that describes how to prepare HTTP requests to send to the source API.
1470
1470
  anyOf:
@@ -1978,6 +1978,10 @@ definitions:
1978
1978
  - "$ref": "#/definitions/SelectiveAuthenticator"
1979
1979
  - "$ref": "#/definitions/CustomAuthenticator"
1980
1980
  - "$ref": "#/definitions/LegacySessionTokenAuthenticator"
1981
+ fetch_properties_from_endpoint:
1982
+ title: Fetch Properties from Endpoint
1983
+ 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.
1984
+ "$ref": "#/definitions/PropertiesFromEndpoint"
1981
1985
  request_body_data:
1982
1986
  title: Request Body Payload (Non-JSON)
1983
1987
  description: Specifies how to populate the body of the request with a non-JSON payload. Plain text will be sent as is, whereas objects will be converted to a urlencoded form.
@@ -2370,7 +2374,7 @@ definitions:
2370
2374
  properties:
2371
2375
  type:
2372
2376
  type: string
2373
- enum: [ KeyTransformation ]
2377
+ enum: [KeyTransformation]
2374
2378
  prefix:
2375
2379
  title: Key Prefix
2376
2380
  description: Prefix to add for object keys. If not provided original keys remain unchanged.
@@ -1,3 +1,5 @@
1
+ # Copyright (c) 2025 Airbyte, Inc., all rights reserved.
2
+
1
3
  # generated by datamodel-codegen:
2
4
  # filename: declarative_component_schema.yaml
3
5
 
@@ -2252,6 +2254,11 @@ class HttpRequester(BaseModel):
2252
2254
  description="Authentication method to use for requests sent to the API.",
2253
2255
  title="Authenticator",
2254
2256
  )
2257
+ fetch_properties_from_endpoint: Optional[PropertiesFromEndpoint] = Field(
2258
+ None,
2259
+ 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.",
2260
+ title="Fetch Properties from Endpoint",
2261
+ )
2255
2262
  request_body_data: Optional[Union[Dict[str, str], str]] = Field(
2256
2263
  None,
2257
2264
  description="Specifies how to populate the body of the request with a non-JSON payload. Plain text will be sent as is, whereas objects will be converted to a urlencoded form.",
@@ -2951,16 +2951,19 @@ class ModelToComponentFactory:
2951
2951
 
2952
2952
  query_properties: Optional[QueryProperties] = None
2953
2953
  query_properties_key: Optional[str] = None
2954
- if (
2955
- hasattr(model.requester, "request_parameters")
2956
- and model.requester.request_parameters
2957
- and isinstance(model.requester.request_parameters, Mapping)
2958
- ):
2954
+ if self._query_properties_in_request_parameters(model.requester):
2955
+ # It is better to be explicit about an error if PropertiesFromEndpoint is defined in multiple
2956
+ # places instead of default to request_parameters which isn't clearly documented
2957
+ if (
2958
+ hasattr(model.requester, "fetch_properties_from_endpoint")
2959
+ and model.requester.fetch_properties_from_endpoint
2960
+ ):
2961
+ raise ValueError(
2962
+ f"PropertiesFromEndpoint should only be specified once per stream, but found in {model.requester.type}.fetch_properties_from_endpoint and {model.requester.type}.request_parameters"
2963
+ )
2964
+
2959
2965
  query_properties_definitions = []
2960
- for key, request_parameter in model.requester.request_parameters.items():
2961
- # When translating JSON schema into Pydantic models, enforcing types for arrays containing both
2962
- # concrete string complex object definitions like QueryProperties would get resolved to Union[str, Any].
2963
- # This adds the extra validation that we couldn't get for free in Pydantic model generation
2966
+ for key, request_parameter in model.requester.request_parameters.items(): # type: ignore # request_parameters is already validated to be a Mapping using _query_properties_in_request_parameters()
2964
2967
  if isinstance(request_parameter, QueryPropertiesModel):
2965
2968
  query_properties_key = key
2966
2969
  query_properties_definitions.append(request_parameter)
@@ -2974,6 +2977,21 @@ class ModelToComponentFactory:
2974
2977
  query_properties = self._create_component_from_model(
2975
2978
  model=query_properties_definitions[0], config=config
2976
2979
  )
2980
+ elif (
2981
+ hasattr(model.requester, "fetch_properties_from_endpoint")
2982
+ and model.requester.fetch_properties_from_endpoint
2983
+ ):
2984
+ query_properties_definition = QueryPropertiesModel(
2985
+ type="QueryProperties",
2986
+ property_list=model.requester.fetch_properties_from_endpoint,
2987
+ always_include_properties=None,
2988
+ property_chunking=None,
2989
+ ) # type: ignore # $parameters has a default value
2990
+
2991
+ query_properties = self.create_query_properties(
2992
+ model=query_properties_definition,
2993
+ config=config,
2994
+ )
2977
2995
 
2978
2996
  requester = self._create_component_from_model(
2979
2997
  model=model.requester,
@@ -3093,6 +3111,19 @@ class ModelToComponentFactory:
3093
3111
  parameters=model.parameters or {},
3094
3112
  )
3095
3113
 
3114
+ @staticmethod
3115
+ def _query_properties_in_request_parameters(
3116
+ requester: Union[HttpRequesterModel, CustomRequesterModel],
3117
+ ) -> bool:
3118
+ if not hasattr(requester, "request_parameters"):
3119
+ return False
3120
+ request_parameters = requester.request_parameters
3121
+ if request_parameters and isinstance(request_parameters, Mapping):
3122
+ for request_parameter in request_parameters.values():
3123
+ if isinstance(request_parameter, QueryPropertiesModel):
3124
+ return True
3125
+ return False
3126
+
3096
3127
  @staticmethod
3097
3128
  def _remove_query_properties(
3098
3129
  request_parameters: Mapping[str, Union[str, QueryPropertiesModel]],
@@ -46,13 +46,3 @@ class QueryProperties:
46
46
  )
47
47
  else:
48
48
  yield list(fields)
49
-
50
- # delete later, but leaving this to keep the discussion thread on the PR from getting hidden
51
- def has_multiple_chunks(self, stream_slice: Optional[StreamSlice]) -> bool:
52
- property_chunks = iter(self.get_request_property_chunks(stream_slice=stream_slice))
53
- try:
54
- next(property_chunks)
55
- next(property_chunks)
56
- return True
57
- except StopIteration:
58
- return False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 6.47.2
3
+ Version: 6.48.0
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -78,7 +78,7 @@ airbyte_cdk/sources/declarative/concurrent_declarative_source.py,sha256=GoZJ8Oxb
78
78
  airbyte_cdk/sources/declarative/datetime/__init__.py,sha256=4Hw-PX1-VgESLF16cDdvuYCzGJtHntThLF4qIiULWeo,61
79
79
  airbyte_cdk/sources/declarative/datetime/datetime_parser.py,sha256=_zGNGq31RNy_0QBLt_EcTvgPyhj7urPdx6oA3M5-r3o,3150
80
80
  airbyte_cdk/sources/declarative/datetime/min_max_datetime.py,sha256=0BHBtDNQZfvwM45-tY5pNlTcKAFSGGNxemoi0Jic-0E,5785
81
- airbyte_cdk/sources/declarative/declarative_component_schema.yaml,sha256=_I1EGLpctW6PRAQVhtxvUuwXCxbYcl2IfxiJyN_MXFA,161909
81
+ airbyte_cdk/sources/declarative/declarative_component_schema.yaml,sha256=I0jTe3nUqS5pW-LbdOQlYuHZIJC3nNAf_LV7XgmfA4g,162221
82
82
  airbyte_cdk/sources/declarative/declarative_source.py,sha256=nF7wBqFd3AQmEKAm4CnIo29CJoQL562cJGSCeL8U8bA,1531
83
83
  airbyte_cdk/sources/declarative/declarative_stream.py,sha256=dCRlddBUSaJmBNBz1pSO1r2rTw8AP5d2_vlmIeGs2gg,10767
84
84
  airbyte_cdk/sources/declarative/decoders/__init__.py,sha256=JHb_0d3SE6kNY10mxA5YBEKPeSbsWYjByq1gUQxepoE,953
@@ -121,14 +121,14 @@ airbyte_cdk/sources/declarative/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW
121
121
  airbyte_cdk/sources/declarative/migrations/legacy_to_per_partition_state_migration.py,sha256=iemy3fKLczcU0-Aor7tx5jcT6DRedKMqyK7kCOp01hg,3924
122
122
  airbyte_cdk/sources/declarative/migrations/state_migration.py,sha256=KWPjealMLKSMtajXgkdGgKg7EmTLR-CqqD7UIh0-eDU,794
123
123
  airbyte_cdk/sources/declarative/models/__init__.py,sha256=nUFxNCiKeYRVXuZEKA7GD-lTHxsiKcQ8FitZjKhPIvE,100
124
- airbyte_cdk/sources/declarative/models/declarative_component_schema.py,sha256=KX9eu7hpkfZHPc8PgzuTLq61Qe_SQ9ZwqCU_Q5Ay698,114532
124
+ airbyte_cdk/sources/declarative/models/declarative_component_schema.py,sha256=i38088qAfh5YMIOEkHdOVqMwDDCayAYtj66EHb3eJNE,114915
125
125
  airbyte_cdk/sources/declarative/parsers/__init__.py,sha256=ZnqYNxHsKCgO38IwB34RQyRMXTs4GTvlRi3ImKnIioo,61
126
126
  airbyte_cdk/sources/declarative/parsers/custom_code_compiler.py,sha256=nlVvHC511NUyDEEIRBkoeDTAvLqKNp-hRy8D19z8tdk,5941
127
127
  airbyte_cdk/sources/declarative/parsers/custom_exceptions.py,sha256=wnRUP0Xeru9Rbu5OexXSDN9QWDo8YU4tT9M2LDVOgGA,802
128
128
  airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py,sha256=RUyFZS0zslLb7UfQrvqMC--k5CVLNSp7zHw6kbosvKE,9688
129
129
  airbyte_cdk/sources/declarative/parsers/manifest_normalizer.py,sha256=laBy7ebjA-PiNwc-50U4FHvMqS_mmHvnabxgFs4CjGw,17069
130
130
  airbyte_cdk/sources/declarative/parsers/manifest_reference_resolver.py,sha256=pJmg78vqE5VfUrF_KJnWjucQ4k9IWFULeAxHCowrHXE,6806
131
- airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=JX5YAUoTGIjTxIGJoIbRoOvk2piHBNnPQDseSOQzoR0,162286
131
+ airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=DGHB4nWwsm4YLuWHhuOjAdeyVDY2U3CdbAiGRdm1YF0,163771
132
132
  airbyte_cdk/sources/declarative/partition_routers/__init__.py,sha256=TBC9AkGaUqHm2IKHMPN6punBIcY5tWGULowcLoAVkfw,1109
133
133
  airbyte_cdk/sources/declarative/partition_routers/async_job_partition_router.py,sha256=VelO7zKqKtzMJ35jyFeg0ypJLQC0plqqIBNXoBW1G2E,3001
134
134
  airbyte_cdk/sources/declarative/partition_routers/cartesian_product_stream_slicer.py,sha256=c5cuVFM6NFkuQqG8Z5IwkBuwDrvXZN1CunUOM_L0ezg,6892
@@ -167,7 +167,7 @@ airbyte_cdk/sources/declarative/requesters/paginators/strategies/stop_condition.
167
167
  airbyte_cdk/sources/declarative/requesters/query_properties/__init__.py,sha256=sHwHVuN6djuRBF7zQb-HmINV0By4wE5j_i6TjmIPMzQ,494
168
168
  airbyte_cdk/sources/declarative/requesters/query_properties/properties_from_endpoint.py,sha256=3h9Ae6TNGagh9sMYWdG5KoEFWDlqUWZ5fkswTPreveM,1616
169
169
  airbyte_cdk/sources/declarative/requesters/query_properties/property_chunking.py,sha256=G-kHHopdScW8oLqLOEaCwgk6Ri8H-7BprZyaw1uKV4s,2982
170
- airbyte_cdk/sources/declarative/requesters/query_properties/query_properties.py,sha256=2VWhgphAFKmHJhzp-UoSP9_QR3eYOLPT0nzMDyglBV4,2650
170
+ airbyte_cdk/sources/declarative/requesters/query_properties/query_properties.py,sha256=SWJhthd-CudJZDNOXK8maMc94BI3pDOK00xyL92Qzcs,2220
171
171
  airbyte_cdk/sources/declarative/requesters/query_properties/strategies/__init__.py,sha256=ojiPj9eVU7SuNpF3RZwhZWW21IYLQYEoxpzg1rCdvNM,350
172
172
  airbyte_cdk/sources/declarative/requesters/query_properties/strategies/group_by_key.py,sha256=np4uTwSpQvXxubIzVbwSDX0Xf3EgVn8kkhs6zYLOdAQ,1081
173
173
  airbyte_cdk/sources/declarative/requesters/query_properties/strategies/merge_strategy.py,sha256=iuk9QxpwvKVtdrq9eadQVkZ-Sfk3qhyyAAErprBfw2s,516
@@ -396,9 +396,9 @@ airbyte_cdk/utils/slice_hasher.py,sha256=EDxgROHDbfG-QKQb59m7h_7crN1tRiawdf5uU7G
396
396
  airbyte_cdk/utils/spec_schema_transformations.py,sha256=-5HTuNsnDBAhj-oLeQXwpTGA0HdcjFOf2zTEMUTTg_Y,816
397
397
  airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
398
398
  airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
399
- airbyte_cdk-6.47.2.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
400
- airbyte_cdk-6.47.2.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
401
- airbyte_cdk-6.47.2.dist-info/METADATA,sha256=hKm118q6Iw_E3CKxiCZjXAPauBtssPkRvsmRVzeomvY,6323
402
- airbyte_cdk-6.47.2.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
403
- airbyte_cdk-6.47.2.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
404
- airbyte_cdk-6.47.2.dist-info/RECORD,,
399
+ airbyte_cdk-6.48.0.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
400
+ airbyte_cdk-6.48.0.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
401
+ airbyte_cdk-6.48.0.dist-info/METADATA,sha256=slRcZy2PXZpm5mLpefKQWolH6bgEoo1Wy285FcBhxvc,6323
402
+ airbyte_cdk-6.48.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
403
+ airbyte_cdk-6.48.0.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
404
+ airbyte_cdk-6.48.0.dist-info/RECORD,,