Skip to content

Commit 4378007

Browse files
committed
Update factory
1 parent 3c87c74 commit 4378007

File tree

3 files changed

+6
-25
lines changed

3 files changed

+6
-25
lines changed

airbyte_cdk/sources/declarative/declarative_component_schema.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,7 +1743,7 @@ definitions:
17431743
additionalProperties: true
17441744
KeyValueExtractor:
17451745
title: Key Value Extractor
1746-
description: Record extractor that extract with .
1746+
description: Record extractor that combines keys and values from two separate extractors.
17471747
type: object
17481748
required:
17491749
- type
@@ -1754,12 +1754,10 @@ definitions:
17541754
type: string
17551755
enum: [ KeyValueExtractor ]
17561756
keys_extractor:
1757-
description: placeholder
17581757
anyOf:
17591758
- "$ref": "#/definitions/DpathExtractor"
17601759
- "$ref": "#/definitions/CustomRecordExtractor"
17611760
values_extractor:
1762-
description: placeholder
17631761
anyOf:
17641762
- "$ref": "#/definitions/DpathExtractor"
17651763
- "$ref": "#/definitions/CustomRecordExtractor"

airbyte_cdk/sources/declarative/models/declarative_component_schema.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,12 +1852,8 @@ class DefaultPaginator(BaseModel):
18521852

18531853
class KeyValueExtractor(BaseModel):
18541854
type: Literal["KeyValueExtractor"]
1855-
keys_extractor: Union[DpathExtractor, CustomRecordExtractor] = Field(
1856-
..., description="placeholder"
1857-
)
1858-
values_extractor: Union[DpathExtractor, CustomRecordExtractor] = Field(
1859-
..., description="placeholder"
1860-
)
1855+
keys_extractor: Union[DpathExtractor, CustomRecordExtractor]
1856+
values_extractor: Union[DpathExtractor, CustomRecordExtractor]
18611857
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
18621858

18631859

airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2453,14 +2453,10 @@ def create_dynamic_schema_loader(
24532453
schema_type_identifier = self._create_component_from_model(
24542454
model.schema_type_identifier, config=config, parameters=model.parameters or {}
24552455
)
2456-
schema_filter = self._create_component_from_model(
2457-
model.schema_filter, config=config, parameters=model.parameters or {}
2458-
)
24592456
return DynamicSchemaLoader(
24602457
retriever=retriever,
24612458
config=config,
24622459
schema_transformations=schema_transformations,
2463-
schema_filter=schema_filter,
24642460
schema_type_identifier=schema_type_identifier,
24652461
parameters=model.parameters or {},
24662462
)
@@ -3622,7 +3618,6 @@ def create_components_mapping_definition(
36223618
field_path=field_path, # type: ignore[arg-type] # field_path can be str and InterpolatedString
36233619
value=interpolated_value,
36243620
value_type=ModelToComponentFactory._json_schema_type_name_to_type(model.value_type),
3625-
create_or_update=model.create_or_update,
36263621
parameters=model.parameters or {},
36273622
)
36283623

@@ -3669,24 +3664,16 @@ def create_stream_config(
36693664

36703665
return StreamConfig(
36713666
configs_pointer=model_configs_pointer,
3672-
default_values=model.default_values,
36733667
parameters=model.parameters or {},
36743668
)
36753669

36763670
def create_config_components_resolver(
36773671
self, model: ConfigComponentsResolverModel, config: Config
36783672
) -> Any:
3679-
model_stream_configs = (
3680-
model.stream_config if isinstance(model.stream_config, list) else [model.stream_config]
3673+
stream_config = self._create_component_from_model(
3674+
model.stream_config, config=config, parameters=model.parameters or {}
36813675
)
36823676

3683-
stream_configs = [
3684-
self._create_component_from_model(
3685-
stream_config, config=config, parameters=model.parameters or {}
3686-
)
3687-
for stream_config in model_stream_configs
3688-
]
3689-
36903677
components_mapping = [
36913678
self._create_component_from_model(
36923679
model=components_mapping_definition_model,
@@ -3699,7 +3686,7 @@ def create_config_components_resolver(
36993686
]
37003687

37013688
return ConfigComponentsResolver(
3702-
stream_configs=stream_configs,
3689+
stream_config=stream_config,
37033690
config=config,
37043691
components_mapping=components_mapping,
37053692
parameters=model.parameters or {},

0 commit comments

Comments
 (0)