From e382ebeb412baf0873b99b3b9ab9bef83042ed60 Mon Sep 17 00:00:00 2001 From: Andrei Vishniakov <31008759+avishniakov@users.noreply.github.com> Date: Wed, 27 Sep 2023 14:42:01 +0200 Subject: [PATCH 1/3] Fix MLflow registry methods with empty metadata --- template/steps/inference/inference_get_current_version.py | 1 - template/steps/promotion/promote_get_versions.py | 2 -- ...re_promotion %}promote_metric_compare_promoter.py{% endif %} | 2 -- 3 files changed, 5 deletions(-) diff --git a/template/steps/inference/inference_get_current_version.py b/template/steps/inference/inference_get_current_version.py index bdcecd3..0454d87 100644 --- a/template/steps/inference/inference_get_current_version.py +++ b/template/steps/inference/inference_get_current_version.py @@ -25,7 +25,6 @@ def inference_get_current_version() -> Annotated[str, "model_version"]: current_version = model_registry.list_model_versions( name=MetaConfig.mlflow_model_name, - metadata={}, stage=MetaConfig.target_env, )[0].version logger.info( diff --git a/template/steps/promotion/promote_get_versions.py b/template/steps/promotion/promote_get_versions.py index 879fda4..52d3529 100644 --- a/template/steps/promotion/promote_get_versions.py +++ b/template/steps/promotion/promote_get_versions.py @@ -32,7 +32,6 @@ def promote_get_versions() -> ( ### ADD YOUR OWN CODE HERE - THIS IS JUST AN EXAMPLE ### none_versions = model_registry.list_model_versions( name=MetaConfig.mlflow_model_name, - metadata={}, stage=None, ) latest_versions = none_versions[0].version @@ -40,7 +39,6 @@ def promote_get_versions() -> ( target_versions = model_registry.list_model_versions( name=MetaConfig.mlflow_model_name, - metadata={}, stage=MetaConfig.target_env, ) current_version = latest_versions diff --git a/template/steps/promotion/{% if metric_compare_promotion %}promote_metric_compare_promoter.py{% endif %} b/template/steps/promotion/{% if metric_compare_promotion %}promote_metric_compare_promoter.py{% endif %} index 00bd6e4..045f1f7 100644 --- a/template/steps/promotion/{% if metric_compare_promotion %}promote_metric_compare_promoter.py{% endif %} +++ b/template/steps/promotion/{% if metric_compare_promotion %}promote_metric_compare_promoter.py{% endif %} @@ -72,13 +72,11 @@ def promote_metric_compare_promoter( name=MetaConfig.mlflow_model_name, version=current_version, stage=ModelVersionStage.ARCHIVED, - metadata={}, ) model_registry.update_model_version( name=MetaConfig.mlflow_model_name, version=latest_version, stage=MetaConfig.target_env, - metadata={}, ) promoted_version = latest_version From 75de9fc8ff683b9690889d981be69031a15177f0 Mon Sep 17 00:00:00 2001 From: Andrei Vishniakov <31008759+avishniakov@users.noreply.github.com> Date: Wed, 27 Sep 2023 15:10:13 +0200 Subject: [PATCH 2/3] Fix MLflow registry methods with empty metadata --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a81ca4..d9a6fcb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,3 +35,4 @@ jobs: with: stack-name: ${{ matrix.stack-name }} python-version: ${{ matrix.python-version }} + ref-zenml: bugfix/OSS-2475-fix-mlflow-registry From 896d61e76d2f5811dc38f564dd3ad1d4717a62fd Mon Sep 17 00:00:00 2001 From: Andrei Vishniakov <31008759+avishniakov@users.noreply.github.com> Date: Thu, 28 Sep 2023 08:29:32 +0200 Subject: [PATCH 3/3] remove ref-zenml --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9a6fcb..0a81ca4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,4 +35,3 @@ jobs: with: stack-name: ${{ matrix.stack-name }} python-version: ${{ matrix.python-version }} - ref-zenml: bugfix/OSS-2475-fix-mlflow-registry