airbyte-cdk 6.56.8__py3-none-any.whl → 6.57.1__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.
@@ -3121,15 +3121,12 @@ definitions:
3121
3121
  type:
3122
3122
  type: string
3123
3123
  enum: [ParentStreamConfig]
3124
- lazy_read_pointer:
3125
- title: Lazy Read Pointer
3126
- description: If set, this will enable lazy reading, using the initial read of parent records to extract child records.
3127
- type: array
3128
- default: []
3129
- items:
3130
- type: string
3131
- interpolation_context:
3132
- - config
3124
+ stream:
3125
+ title: Parent Stream
3126
+ description: Reference to the parent stream.
3127
+ anyOf:
3128
+ - "$ref": "#/definitions/DeclarativeStream"
3129
+ - "$ref": "#/definitions/StateDelegatingStream"
3133
3130
  parent_key:
3134
3131
  title: Parent Key
3135
3132
  description: The primary key of records from the parent stream that will be used during the retrieval of records for the current substream. This parent identifier field is typically a characteristic of the child records being extracted from the source API.
@@ -3137,12 +3134,6 @@ definitions:
3137
3134
  examples:
3138
3135
  - "id"
3139
3136
  - "{{ config['parent_record_id'] }}"
3140
- stream:
3141
- title: Parent Stream
3142
- description: Reference to the parent stream.
3143
- anyOf:
3144
- - "$ref": "#/definitions/DeclarativeStream"
3145
- - "$ref": "#/definitions/StateDelegatingStream"
3146
3137
  partition_field:
3147
3138
  title: Current Parent Key Value Identifier
3148
3139
  description: While iterating over parent records during a sync, the parent_key value can be referenced by using this field.
@@ -3159,6 +3150,15 @@ definitions:
3159
3150
  description: Indicates whether the parent stream should be read incrementally based on updates in the child stream.
3160
3151
  type: boolean
3161
3152
  default: false
3153
+ lazy_read_pointer:
3154
+ title: Lazy Read Pointer
3155
+ description: If set, this will enable lazy reading, using the initial read of parent records to extract child records.
3156
+ type: array
3157
+ default: []
3158
+ items:
3159
+ type: string
3160
+ interpolation_context:
3161
+ - config
3162
3162
  extra_fields:
3163
3163
  title: Extra Fields
3164
3164
  description: Array of field paths to include as additional fields in the stream slice. Each path is an array of strings representing keys to access fields in the respective parent record. Accessible via `stream_slice.extra_fields`. Missing fields are set to `None`.
@@ -3592,18 +3592,18 @@ definitions:
3592
3592
  default: false
3593
3593
  partition_router:
3594
3594
  title: Partition Router
3595
- description: PartitionRouter component that describes how to partition the stream, enabling incremental syncs and checkpointing.
3596
- default: []
3595
+ description: Used to iteratively execute requests over a set of values, such as a parent stream's records or a list of constant values.
3597
3596
  anyOf:
3598
- - "$ref": "#/definitions/ListPartitionRouter"
3599
3597
  - "$ref": "#/definitions/SubstreamPartitionRouter"
3598
+ - "$ref": "#/definitions/ListPartitionRouter"
3600
3599
  - "$ref": "#/definitions/GroupingPartitionRouter"
3601
3600
  - "$ref": "#/definitions/CustomPartitionRouter"
3602
3601
  - type: array
3602
+ title: Multiple Partition Routers
3603
3603
  items:
3604
3604
  anyOf:
3605
- - "$ref": "#/definitions/ListPartitionRouter"
3606
3605
  - "$ref": "#/definitions/SubstreamPartitionRouter"
3606
+ - "$ref": "#/definitions/ListPartitionRouter"
3607
3607
  - "$ref": "#/definitions/GroupingPartitionRouter"
3608
3608
  - "$ref": "#/definitions/CustomPartitionRouter"
3609
3609
  $parameters:
@@ -4235,6 +4235,11 @@ definitions:
4235
4235
  - "$ref": "#/definitions/HttpComponentsResolver"
4236
4236
  - "$ref": "#/definitions/ConfigComponentsResolver"
4237
4237
  - "$ref": "#/definitions/ParametrizedComponentsResolver"
4238
+ use_parent_parameters:
4239
+ title: Use Parent Parameters
4240
+ description: Whether or not to prioritize parent parameters over component parameters when constructing dynamic streams. Defaults to true for backward compatibility.
4241
+ type: boolean
4242
+ default: true
4238
4243
  required:
4239
4244
  - type
4240
4245
  - stream_template
@@ -4,6 +4,7 @@
4
4
 
5
5
  import builtins
6
6
  import datetime
7
+ import re
7
8
  import typing
8
9
  from typing import Optional, Union
9
10
  from urllib.parse import quote_plus
@@ -194,6 +195,18 @@ def sanitize_url(value: str) -> str:
194
195
  return sanitization_strategy(value)
195
196
 
196
197
 
198
+ def camel_case_to_snake_case(value: str) -> str:
199
+ """
200
+ Converts CamelCase strings to snake_case format
201
+
202
+ Usage:
203
+ `"{{ camel_case_to_snake_case('CamelCase') }}"`
204
+ :param value: string to convert from CamelCase to snake_case
205
+ :return: snake_case formatted string
206
+ """
207
+ return re.sub(r"(?<!^)(?=[A-Z])", "_", value).lower()
208
+
209
+
197
210
  _macros_list = [
198
211
  now_utc,
199
212
  today_utc,
@@ -206,5 +219,6 @@ _macros_list = [
206
219
  today_with_timezone,
207
220
  str_to_datetime,
208
221
  sanitize_url,
222
+ camel_case_to_snake_case,
209
223
  ]
210
224
  macros = {f.__name__: f for f in _macros_list}
@@ -553,9 +553,13 @@ class ManifestDeclarativeSource(DeclarativeSource):
553
553
  for dynamic_stream in components_resolver.resolve_components(
554
554
  stream_template_config=stream_template_config
555
555
  ):
556
+ # Get the use_parent_parameters configuration from the dynamic definition
557
+ # Default to True for backward compatibility, since connectors were already using it by default when this param was added
558
+ use_parent_parameters = dynamic_definition.get("use_parent_parameters", True)
559
+
556
560
  dynamic_stream = {
557
561
  **ManifestComponentTransformer().propagate_types_and_parameters(
558
- "", dynamic_stream, {}, use_parent_parameters=True
562
+ "", dynamic_stream, {}, use_parent_parameters=use_parent_parameters
559
563
  )
560
564
  }
561
565
 
@@ -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
 
@@ -2648,10 +2650,8 @@ class DynamicSchemaLoader(BaseModel):
2648
2650
 
2649
2651
  class ParentStreamConfig(BaseModel):
2650
2652
  type: Literal["ParentStreamConfig"]
2651
- lazy_read_pointer: Optional[List[str]] = Field(
2652
- [],
2653
- description="If set, this will enable lazy reading, using the initial read of parent records to extract child records.",
2654
- title="Lazy Read Pointer",
2653
+ stream: Union[DeclarativeStream, StateDelegatingStream] = Field(
2654
+ ..., description="Reference to the parent stream.", title="Parent Stream"
2655
2655
  )
2656
2656
  parent_key: str = Field(
2657
2657
  ...,
@@ -2659,9 +2659,6 @@ class ParentStreamConfig(BaseModel):
2659
2659
  examples=["id", "{{ config['parent_record_id'] }}"],
2660
2660
  title="Parent Key",
2661
2661
  )
2662
- stream: Union[DeclarativeStream, StateDelegatingStream] = Field(
2663
- ..., description="Reference to the parent stream.", title="Parent Stream"
2664
- )
2665
2662
  partition_field: str = Field(
2666
2663
  ...,
2667
2664
  description="While iterating over parent records during a sync, the parent_key value can be referenced by using this field.",
@@ -2678,6 +2675,11 @@ class ParentStreamConfig(BaseModel):
2678
2675
  description="Indicates whether the parent stream should be read incrementally based on updates in the child stream.",
2679
2676
  title="Incremental Dependency",
2680
2677
  )
2678
+ lazy_read_pointer: Optional[List[str]] = Field(
2679
+ [],
2680
+ description="If set, this will enable lazy reading, using the initial read of parent records to extract child records.",
2681
+ title="Lazy Read Pointer",
2682
+ )
2681
2683
  extra_fields: Optional[List[List[str]]] = Field(
2682
2684
  None,
2683
2685
  description="Array of field paths to include as additional fields in the stream slice. Each path is an array of strings representing keys to access fields in the respective parent record. Accessible via `stream_slice.extra_fields`. Missing fields are set to `None`.",
@@ -2772,22 +2774,22 @@ class SimpleRetriever(BaseModel):
2772
2774
  )
2773
2775
  partition_router: Optional[
2774
2776
  Union[
2775
- ListPartitionRouter,
2776
2777
  SubstreamPartitionRouter,
2778
+ ListPartitionRouter,
2777
2779
  GroupingPartitionRouter,
2778
2780
  CustomPartitionRouter,
2779
2781
  List[
2780
2782
  Union[
2781
- ListPartitionRouter,
2782
2783
  SubstreamPartitionRouter,
2784
+ ListPartitionRouter,
2783
2785
  GroupingPartitionRouter,
2784
2786
  CustomPartitionRouter,
2785
2787
  ]
2786
2788
  ],
2787
2789
  ]
2788
2790
  ] = Field(
2789
- [],
2790
- description="PartitionRouter component that describes how to partition the stream, enabling incremental syncs and checkpointing.",
2791
+ None,
2792
+ description="Used to iteratively execute requests over a set of values, such as a parent stream's records or a list of constant values.",
2791
2793
  title="Partition Router",
2792
2794
  )
2793
2795
  parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
@@ -2958,6 +2960,11 @@ class DynamicDeclarativeStream(BaseModel):
2958
2960
  description="Component resolve and populates stream templates with components values.",
2959
2961
  title="Components Resolver",
2960
2962
  )
2963
+ use_parent_parameters: Optional[bool] = Field(
2964
+ True,
2965
+ description="Whether or not to prioritize parent parameters over component parameters when constructing dynamic streams. Defaults to true for backward compatibility.",
2966
+ title="Use Parent Parameters",
2967
+ )
2961
2968
 
2962
2969
 
2963
2970
  ComplexFieldType.update_forward_refs()
@@ -21,6 +21,4 @@ class ConnectorBuilderFileUploader(FileUploader):
21
21
 
22
22
  def upload(self, record: Record) -> None:
23
23
  self.file_uploader.upload(record=record)
24
- for file_reference_key, file_reference_value in record.file_reference.__dict__.items():
25
- if not file_reference_key.startswith("_"):
26
- record.data[file_reference_key] = file_reference_value # type: ignore
24
+ record.data["source_file_relative_path"] = record.file_reference.source_file_relative_path # type: ignore
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-cdk
3
- Version: 6.56.8
3
+ Version: 6.57.1
4
4
  Summary: A framework for writing Airbyte Connectors.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -32,6 +32,7 @@ Requires-Dist: cachetools
32
32
  Requires-Dist: click (>=8.1.8,<9.0.0)
33
33
  Requires-Dist: cohere (==4.21) ; extra == "vector-db-based"
34
34
  Requires-Dist: cryptography (>=44.0.0,<45.0.0)
35
+ Requires-Dist: dateparser (>=1.2.2,<2.0.0)
35
36
  Requires-Dist: dpath (>=2.1.6,<3.0.0)
36
37
  Requires-Dist: dunamai (>=1.22.0,<2.0.0)
37
38
  Requires-Dist: fastavro (>=1.8.0,<1.9.0) ; extra == "file-based"
@@ -90,7 +90,7 @@ airbyte_cdk/sources/declarative/concurrent_declarative_source.py,sha256=rQz9gXp3
90
90
  airbyte_cdk/sources/declarative/datetime/__init__.py,sha256=4Hw-PX1-VgESLF16cDdvuYCzGJtHntThLF4qIiULWeo,61
91
91
  airbyte_cdk/sources/declarative/datetime/datetime_parser.py,sha256=_zGNGq31RNy_0QBLt_EcTvgPyhj7urPdx6oA3M5-r3o,3150
92
92
  airbyte_cdk/sources/declarative/datetime/min_max_datetime.py,sha256=0BHBtDNQZfvwM45-tY5pNlTcKAFSGGNxemoi0Jic-0E,5785
93
- airbyte_cdk/sources/declarative/declarative_component_schema.yaml,sha256=kl0_g1yx8sdtDQ8dUQXXW3uHBLyjgM2DMFhimfmUNS4,180477
93
+ airbyte_cdk/sources/declarative/declarative_component_schema.yaml,sha256=WI5I5FWDosWpFBfWQ6uwkLTQBujPq-Hn8kW-xZIpZcg,180794
94
94
  airbyte_cdk/sources/declarative/declarative_source.py,sha256=qmyMnnet92eGc3C22yBtpvD5UZjqdhsAafP_zxI5wp8,1814
95
95
  airbyte_cdk/sources/declarative/declarative_stream.py,sha256=dCRlddBUSaJmBNBz1pSO1r2rTw8AP5d2_vlmIeGs2gg,10767
96
96
  airbyte_cdk/sources/declarative/decoders/__init__.py,sha256=JHb_0d3SE6kNY10mxA5YBEKPeSbsWYjByq1gUQxepoE,953
@@ -127,14 +127,14 @@ airbyte_cdk/sources/declarative/interpolation/interpolated_nested_mapping.py,sha
127
127
  airbyte_cdk/sources/declarative/interpolation/interpolated_string.py,sha256=CQkHqGlfa87G6VYMtBAQWin7ECKpfMdrDcg0JO5_rhc,3212
128
128
  airbyte_cdk/sources/declarative/interpolation/interpolation.py,sha256=9IoeuWam3L6GyN10L6U8xNWXmkt9cnahSDNkez1OmFY,982
129
129
  airbyte_cdk/sources/declarative/interpolation/jinja.py,sha256=oFGKs3oX0xO6DOL4E9x8rhxwbEoRcgx4HJVIL1RQ9c4,7269
130
- airbyte_cdk/sources/declarative/interpolation/macros.py,sha256=xRcmjape4_WGmKMJpmBsKY0k4OHJDM46Hv3V-dlSz3w,5640
131
- airbyte_cdk/sources/declarative/manifest_declarative_source.py,sha256=RDzxRKc3JDJHaSM0I_Ezuo94LDNwnNLVpqt0tp3CHp0,25743
130
+ airbyte_cdk/sources/declarative/interpolation/macros.py,sha256=RpsAYG75bW0js2fQCzAN1nf3oeGyXwyt0LhJCHnlaUA,6031
131
+ airbyte_cdk/sources/declarative/manifest_declarative_source.py,sha256=ADCYOQFMPR_4_l3lUB76AOOshUJ_QM46ZoEMT0On3Ck,26083
132
132
  airbyte_cdk/sources/declarative/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
133
133
  airbyte_cdk/sources/declarative/migrations/legacy_to_per_partition_state_migration.py,sha256=V2lpYE9LJKvz6BUViHk4vaRGndxNABmPbDCtyYdkqaE,4013
134
134
  airbyte_cdk/sources/declarative/migrations/state_migration.py,sha256=KWPjealMLKSMtajXgkdGgKg7EmTLR-CqqD7UIh0-eDU,794
135
135
  airbyte_cdk/sources/declarative/models/__init__.py,sha256=nUFxNCiKeYRVXuZEKA7GD-lTHxsiKcQ8FitZjKhPIvE,100
136
136
  airbyte_cdk/sources/declarative/models/base_model_with_deprecations.py,sha256=Imnj3yef0aqRdLfaUxkIYISUb8YkiPrRH_wBd-x8HjM,5999
137
- airbyte_cdk/sources/declarative/models/declarative_component_schema.py,sha256=zNCb_E42naPkhWmUuquHRx8_7xXO6IbS3VZm-9pkqCc,126988
137
+ airbyte_cdk/sources/declarative/models/declarative_component_schema.py,sha256=6n2imTLSbP1RVl4G87cEbXsIVvp5lDIFG6zQApf-Vvs,127341
138
138
  airbyte_cdk/sources/declarative/parsers/__init__.py,sha256=ZnqYNxHsKCgO38IwB34RQyRMXTs4GTvlRi3ImKnIioo,61
139
139
  airbyte_cdk/sources/declarative/parsers/custom_code_compiler.py,sha256=nlVvHC511NUyDEEIRBkoeDTAvLqKNp-hRy8D19z8tdk,5941
140
140
  airbyte_cdk/sources/declarative/parsers/custom_exceptions.py,sha256=wnRUP0Xeru9Rbu5OexXSDN9QWDo8YU4tT9M2LDVOgGA,802
@@ -202,7 +202,7 @@ airbyte_cdk/sources/declarative/resolvers/parametrized_components_resolver.py,sh
202
202
  airbyte_cdk/sources/declarative/retrievers/__init__.py,sha256=LQQspOQS9oyOx9cGnRIz1mq-8DZCBysyDJDPqjy1HvM,449
203
203
  airbyte_cdk/sources/declarative/retrievers/async_retriever.py,sha256=6oZtnCHm9NdDvjTSrVwPQOXGSdETSIR7eWH2vFjM7jI,4855
204
204
  airbyte_cdk/sources/declarative/retrievers/file_uploader/__init__.py,sha256=ovs0oZGPEEw-V4asqr0D1Xty2u7tR8ADhRuHNgXGuWQ,490
205
- airbyte_cdk/sources/declarative/retrievers/file_uploader/connector_builder_file_uploader.py,sha256=wHGnluTJ6HVbCkSaNNQQN2t9ZzhaFGoo_pzXTz54gBY,878
205
+ airbyte_cdk/sources/declarative/retrievers/file_uploader/connector_builder_file_uploader.py,sha256=ulES1kVkgoXkAWRMPLYC0ToyCLYTWLsDuuS-I7XP4zg,755
206
206
  airbyte_cdk/sources/declarative/retrievers/file_uploader/default_file_uploader.py,sha256=7AFJxJknE7whofFBxoBp-EUrpu2QyZh1dwEq1jb3D-I,3689
207
207
  airbyte_cdk/sources/declarative/retrievers/file_uploader/file_uploader.py,sha256=bWCWQzPokZ9rWmmi3I6RfaG53FhSN5yj3JouRhtnz7E,431
208
208
  airbyte_cdk/sources/declarative/retrievers/file_uploader/file_writer.py,sha256=V8gAFjQXkhX5mwj1NafdcUrMfMBNF1hi0mrdXIl5qEc,359
@@ -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.56.8.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
428
- airbyte_cdk-6.56.8.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
429
- airbyte_cdk-6.56.8.dist-info/METADATA,sha256=-QMqJnVacR50jlwPgnpLNX4Rqnrn5AE4ykNkSXUI0l8,6392
430
- airbyte_cdk-6.56.8.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
431
- airbyte_cdk-6.56.8.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
432
- airbyte_cdk-6.56.8.dist-info/RECORD,,
427
+ airbyte_cdk-6.57.1.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
428
+ airbyte_cdk-6.57.1.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
429
+ airbyte_cdk-6.57.1.dist-info/METADATA,sha256=Ndmh_B_wShbN3S6I0rgwUd26sXE0bskerO_dxRGmfvE,6435
430
+ airbyte_cdk-6.57.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
431
+ airbyte_cdk-6.57.1.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
432
+ airbyte_cdk-6.57.1.dist-info/RECORD,,