Skip to content

Improved deprecation messages for artifact configs and run metadata #3261

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

Merged
Show file tree
Hide file tree
Changes from all 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
13 changes: 8 additions & 5 deletions src/zenml/artifacts/artifact_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,18 @@ def _remove_old_attributes(cls, data: Dict[str, Any]) -> Dict[str, Any]:
)
elif is_model_artifact:
logger.warning(
"`ArtifactConfig.is_model_artifact` is deprecated and will be "
"removed soon. Use `ArtifactConfig.artifact_type` instead."
"`ArtifactConfig(..., is_model_artifact=True)` is deprecated "
"and will be removed soon. Use `ArtifactConfig(..., "
"artifact_type=ArtifactType.MODEL)` instead. For more info: "
"https://docs.zenml.io/user-guide/starter-guide/manage-artifacts"
)
data.setdefault("artifact_type", ArtifactType.MODEL)
elif is_deployment_artifact:
logger.warning(
"`ArtifactConfig.is_deployment_artifact` is deprecated and "
"will be removed soon. Use `ArtifactConfig.artifact_type` "
"instead."
"`ArtifactConfig(..., is_deployment_artifact=True)` is "
"deprecated and will be removed soon. Use `ArtifactConfig(..., "
"artifact_type=ArtifactType.SERVICE)` instead. For more info: "
"https://docs.zenml.io/user-guide/starter-guide/manage-artifacts"
)
data.setdefault("artifact_type", ArtifactType.SERVICE)

Expand Down
4 changes: 3 additions & 1 deletion src/zenml/artifacts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,9 @@ def log_artifact_metadata(
"""
logger.warning(
"The `log_artifact_metadata` function is deprecated and will soon be "
"removed. Please use `log_metadata` instead."
"removed. Instead, you can consider using: "
"`log_metadata(metadata={...}, infer_artifact=True, ...)` instead. For more "
"info: https://docs.zenml.io/how-to/model-management-metrics/track-metrics-metadata/attach-metadata-to-an-artifact"
)

from zenml import log_metadata
Expand Down
4 changes: 3 additions & 1 deletion src/zenml/model/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ def log_model_metadata(
"""
logger.warning(
"The `log_model_metadata` function is deprecated and will soon be "
"removed. Please use `log_metadata` instead."
"removed. Instead, you can consider using: "
"`log_metadata(metadata={...}, infer_model=True)` instead. For more "
"info: https://docs.zenml.io/how-to/model-management-metrics/track-metrics-metadata/attach-metadata-to-a-model"
)

from zenml import log_metadata
Expand Down
Loading