Skip to content

Commit 96034f9

Browse files
Improved deprecation messages for artifact configs and run metadata (#3261)
* improved deprecation messages * Update src/zenml/model/utils.py Co-authored-by: Alexej Penner <[email protected]> * Update src/zenml/artifacts/utils.py Co-authored-by: Alexej Penner <[email protected]> * fixed it again --------- Co-authored-by: Alexej Penner <[email protected]>
1 parent ec1ac38 commit 96034f9

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

src/zenml/artifacts/artifact_config.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,18 @@ def _remove_old_attributes(cls, data: Dict[str, Any]) -> Dict[str, Any]:
104104
)
105105
elif is_model_artifact:
106106
logger.warning(
107-
"`ArtifactConfig.is_model_artifact` is deprecated and will be "
108-
"removed soon. Use `ArtifactConfig.artifact_type` instead."
107+
"`ArtifactConfig(..., is_model_artifact=True)` is deprecated "
108+
"and will be removed soon. Use `ArtifactConfig(..., "
109+
"artifact_type=ArtifactType.MODEL)` instead. For more info: "
110+
"https://docs.zenml.io/user-guide/starter-guide/manage-artifacts"
109111
)
110112
data.setdefault("artifact_type", ArtifactType.MODEL)
111113
elif is_deployment_artifact:
112114
logger.warning(
113-
"`ArtifactConfig.is_deployment_artifact` is deprecated and "
114-
"will be removed soon. Use `ArtifactConfig.artifact_type` "
115-
"instead."
115+
"`ArtifactConfig(..., is_deployment_artifact=True)` is "
116+
"deprecated and will be removed soon. Use `ArtifactConfig(..., "
117+
"artifact_type=ArtifactType.SERVICE)` instead. For more info: "
118+
"https://docs.zenml.io/user-guide/starter-guide/manage-artifacts"
116119
)
117120
data.setdefault("artifact_type", ArtifactType.SERVICE)
118121

src/zenml/artifacts/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,9 @@ def log_artifact_metadata(
414414
"""
415415
logger.warning(
416416
"The `log_artifact_metadata` function is deprecated and will soon be "
417-
"removed. Please use `log_metadata` instead."
417+
"removed. Instead, you can consider using: "
418+
"`log_metadata(metadata={...}, infer_artifact=True, ...)` instead. For more "
419+
"info: https://docs.zenml.io/how-to/model-management-metrics/track-metrics-metadata/attach-metadata-to-an-artifact"
418420
)
419421

420422
from zenml import log_metadata

src/zenml/model/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ def log_model_metadata(
5656
"""
5757
logger.warning(
5858
"The `log_model_metadata` function is deprecated and will soon be "
59-
"removed. Please use `log_metadata` instead."
59+
"removed. Instead, you can consider using: "
60+
"`log_metadata(metadata={...}, infer_model=True)` instead. For more "
61+
"info: https://docs.zenml.io/how-to/model-management-metrics/track-metrics-metadata/attach-metadata-to-a-model"
6062
)
6163

6264
from zenml import log_metadata

0 commit comments

Comments
 (0)