Skip to content

Commit 5668180

Browse files
author
Oleksandr Bazarnov
committed
add __should_migrate flag handling
1 parent d30ae26 commit 5668180

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

airbyte_cdk/connector_builder/connector_builder_handler.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,22 @@ def get_limits(config: Mapping[str, Any]) -> TestLimits:
5555
max_streams = command_config.get(MAX_STREAMS_KEY) or DEFAULT_MAXIMUM_STREAMS
5656
return TestLimits(max_records, max_pages_per_slice, max_slices, max_streams)
5757

58+
def should_migrate_manifest(config: Mapping[str, Any]) -> bool:
59+
"""
60+
Determines whether the manifest should be migrated,
61+
based on the presence of the "__should_migrate" key in the config.
62+
63+
This flag is set by the UI.
64+
"""
65+
return config.get("__should_migrate", False)
5866

5967
def create_source(config: Mapping[str, Any], limits: TestLimits) -> ManifestDeclarativeSource:
6068
manifest = config["__injected_declarative_manifest"]
6169
return ManifestDeclarativeSource(
6270
config=config,
6371
emit_connector_builder_messages=True,
6472
source_config=manifest,
73+
migrate_manifest=should_migrate_manifest(config),
6574
component_factory=ModelToComponentFactory(
6675
emit_connector_builder_messages=True,
6776
limit_pages_fetched_per_slice=limits.max_pages_per_slice,

0 commit comments

Comments
 (0)