From c20db33c1610674cb46a9b31429bd710cf41e0fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yolan=20Honor=C3=A9-Roug=C3=A9?= Date: Wed, 6 Jul 2022 22:23:02 +0200 Subject: [PATCH] :bug: Stop logging a success init message when init fails (#336) --- CHANGELOG.md | 1 + kedro_mlflow/framework/cli/cli.py | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87c0863d..577da15c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Fixed - :bug: Make ``pipeline_ml_factory`` now correctly uses ``kpm_kwargs`` and ``log_model_kwargs`` instead of always using the default values. ([#329](https://github.com/Galileo-Galilei/kedro-mlflow/issues/329)) +- :bug: ``kedro mlflow init`` command no longer raises both a success and an error message when the command is failing. ([#336](https://github.com/Galileo-Galilei/kedro-mlflow/issues/336)) ### Changed diff --git a/kedro_mlflow/framework/cli/cli.py b/kedro_mlflow/framework/cli/cli.py index e3ad45b4..b72765a1 100644 --- a/kedro_mlflow/framework/cli/cli.py +++ b/kedro_mlflow/framework/cli/cli.py @@ -106,6 +106,13 @@ def init(env: str, force: bool, silent: bool): dst=mlflow_yml_path, python_package=project_metadata.package_name, ) + if not silent: + click.secho( + click.style( + f"'{settings.CONF_SOURCE}/{env}/{mlflow_yml}' successfully updated.", + fg="green", + ) + ) except FileNotFoundError: click.secho( click.style( @@ -113,13 +120,6 @@ def init(env: str, force: bool, silent: bool): fg="red", ) ) - if not silent: - click.secho( - click.style( - f"'{settings.CONF_SOURCE}/{env}/{mlflow_yml}' successfully updated.", - fg="green", - ) - ) @mlflow_commands.command()