From acc84c24596ee596355db3b487e263a07a32e5ca Mon Sep 17 00:00:00 2001 From: Hugo Hobson Date: Tue, 1 Apr 2025 10:21:30 +0100 Subject: [PATCH] fix(cli): stop deployment config being overwritten by cli defaults (#13036) `executor_id` and `time_zone` values set in the `deployment` block of a recipe are not being used by `datahub ingest deploy` cli command when deploying recipes. This is because the [cli values take precedence over deployment config](https://github.com/datahub-project/datahub/blob/master/metadata-ingestion/src/datahub/utilities/ingest_utils.py#L63), so where the cli has default values these as always used. Default values should be set in [`DeployOptions`](https://github.com/datahub-project/datahub/blob/master/metadata-ingestion/src/datahub/utilities/ingest_utils.py#L23), not in the cli options. --- metadata-ingestion/src/datahub/cli/ingest_cli.py | 8 ++++---- metadata-ingestion/src/datahub/utilities/ingest_utils.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/metadata-ingestion/src/datahub/cli/ingest_cli.py b/metadata-ingestion/src/datahub/cli/ingest_cli.py index 9b213ab886..a0180a6de5 100644 --- a/metadata-ingestion/src/datahub/cli/ingest_cli.py +++ b/metadata-ingestion/src/datahub/cli/ingest_cli.py @@ -216,9 +216,9 @@ def run( @click.option( "--executor-id", type=str, - default="default", help="Executor id to route execution requests to. Do not use this unless you have configured a custom executor.", required=False, + default=None, ) @click.option( "--cli-version", @@ -239,7 +239,7 @@ def run( type=str, help="Timezone for the schedule in 'America/New_York' format. Uses UTC by default.", required=False, - default="UTC", + default=None, ) @click.option( "--debug", type=bool, help="Should we debug.", required=False, default=False @@ -255,10 +255,10 @@ def deploy( name: Optional[str], config: str, urn: Optional[str], - executor_id: str, + executor_id: Optional[str], cli_version: Optional[str], schedule: Optional[str], - time_zone: str, + time_zone: Optional[str], extra_pip: Optional[str], debug: bool = False, ) -> None: diff --git a/metadata-ingestion/src/datahub/utilities/ingest_utils.py b/metadata-ingestion/src/datahub/utilities/ingest_utils.py index 1782fd5a09..363c82df9c 100644 --- a/metadata-ingestion/src/datahub/utilities/ingest_utils.py +++ b/metadata-ingestion/src/datahub/utilities/ingest_utils.py @@ -32,10 +32,10 @@ def deploy_source_vars( name: Optional[str], config: str, urn: Optional[str], - executor_id: str, + executor_id: Optional[str], cli_version: Optional[str], schedule: Optional[str], - time_zone: str, + time_zone: Optional[str], extra_pip: Optional[str], debug: bool = False, ) -> dict: