Skip to content

Commit 1733ec3

Browse files
authored
chore: reorder and modify title/defaults for partition router fields (#626)
1 parent 2e13549 commit 1733ec3

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

airbyte_cdk/sources/declarative/declarative_component_schema.yaml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3121,28 +3121,19 @@ definitions:
31213121
type:
31223122
type: string
31233123
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"
31333130
parent_key:
31343131
title: Parent Key
31353132
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.
31363133
type: string
31373134
examples:
31383135
- "id"
31393136
- "{{ 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"
31463137
partition_field:
31473138
title: Current Parent Key Value Identifier
31483139
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:
31593150
description: Indicates whether the parent stream should be read incrementally based on updates in the child stream.
31603151
type: boolean
31613152
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
31623162
extra_fields:
31633163
title: Extra Fields
31643164
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:
35923592
default: false
35933593
partition_router:
35943594
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.
35973596
anyOf:
3598-
- "$ref": "#/definitions/ListPartitionRouter"
35993597
- "$ref": "#/definitions/SubstreamPartitionRouter"
3598+
- "$ref": "#/definitions/ListPartitionRouter"
36003599
- "$ref": "#/definitions/GroupingPartitionRouter"
36013600
- "$ref": "#/definitions/CustomPartitionRouter"
36023601
- type: array
3602+
title: Multiple Partition Routers
36033603
items:
36043604
anyOf:
3605-
- "$ref": "#/definitions/ListPartitionRouter"
36063605
- "$ref": "#/definitions/SubstreamPartitionRouter"
3606+
- "$ref": "#/definitions/ListPartitionRouter"
36073607
- "$ref": "#/definitions/GroupingPartitionRouter"
36083608
- "$ref": "#/definitions/CustomPartitionRouter"
36093609
$parameters:

airbyte_cdk/sources/declarative/models/declarative_component_schema.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2648,20 +2648,15 @@ class DynamicSchemaLoader(BaseModel):
26482648

26492649
class ParentStreamConfig(BaseModel):
26502650
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",
2651+
stream: Union[DeclarativeStream, StateDelegatingStream] = Field(
2652+
..., description="Reference to the parent stream.", title="Parent Stream"
26552653
)
26562654
parent_key: str = Field(
26572655
...,
26582656
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.",
26592657
examples=["id", "{{ config['parent_record_id'] }}"],
26602658
title="Parent Key",
26612659
)
2662-
stream: Union[DeclarativeStream, StateDelegatingStream] = Field(
2663-
..., description="Reference to the parent stream.", title="Parent Stream"
2664-
)
26652660
partition_field: str = Field(
26662661
...,
26672662
description="While iterating over parent records during a sync, the parent_key value can be referenced by using this field.",
@@ -2678,6 +2673,11 @@ class ParentStreamConfig(BaseModel):
26782673
description="Indicates whether the parent stream should be read incrementally based on updates in the child stream.",
26792674
title="Incremental Dependency",
26802675
)
2676+
lazy_read_pointer: Optional[List[str]] = Field(
2677+
[],
2678+
description="If set, this will enable lazy reading, using the initial read of parent records to extract child records.",
2679+
title="Lazy Read Pointer",
2680+
)
26812681
extra_fields: Optional[List[List[str]]] = Field(
26822682
None,
26832683
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 +2772,22 @@ class SimpleRetriever(BaseModel):
27722772
)
27732773
partition_router: Optional[
27742774
Union[
2775-
ListPartitionRouter,
27762775
SubstreamPartitionRouter,
2776+
ListPartitionRouter,
27772777
GroupingPartitionRouter,
27782778
CustomPartitionRouter,
27792779
List[
27802780
Union[
2781-
ListPartitionRouter,
27822781
SubstreamPartitionRouter,
2782+
ListPartitionRouter,
27832783
GroupingPartitionRouter,
27842784
CustomPartitionRouter,
27852785
]
27862786
],
27872787
]
27882788
] = Field(
2789-
[],
2790-
description="PartitionRouter component that describes how to partition the stream, enabling incremental syncs and checkpointing.",
2789+
None,
2790+
description="Used to iteratively execute requests over a set of values, such as a parent stream's records or a list of constant values.",
27912791
title="Partition Router",
27922792
)
27932793
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")

0 commit comments

Comments
 (0)