Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MLflow registry methods with empty metadata #10

Merged
merged 3 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ jobs:
with:
stack-name: ${{ matrix.stack-name }}
python-version: ${{ matrix.python-version }}
ref-zenml: bugfix/OSS-2475-fix-mlflow-registry
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This we need to undo before merge right?

Suggested change
ref-zenml: bugfix/OSS-2475-fix-mlflow-registry

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessarily, anyway, it will need adjustment upon the next PR, so it can be kept. But I added it to make tests run smoothly. We can remove it after Macos completes.

1 change: 0 additions & 1 deletion template/steps/inference/inference_get_current_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 0 additions & 2 deletions template/steps/promotion/promote_get_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,13 @@ 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
logger.info(f"Latest model version is {latest_versions}")

target_versions = model_registry.list_model_versions(
name=MetaConfig.mlflow_model_name,
metadata={},
stage=MetaConfig.target_env,
)
current_version = latest_versions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down