Skip to content

Commit

Permalink
Allow filtering artifacts with/without custom names
Browse files Browse the repository at this point in the history
  • Loading branch information
schustmi committed Jan 5, 2024
1 parent 487b4a9 commit 5742120
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/zenml/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2608,6 +2608,7 @@ def list_artifacts(
created: Optional[Union[datetime, str]] = None,
updated: Optional[Union[datetime, str]] = None,
name: Optional[str] = None,
has_custom_name: Optional[bool] = None,
) -> Page[ArtifactResponse]:
"""Get a list of artifacts.
Expand All @@ -2620,6 +2621,7 @@ def list_artifacts(
created: Use to filter by time of creation
updated: Use the last updated date for filtering
name: The name of the artifact to filter by.
has_custom_name: Filter artifact with/without custom names.
Returns:
A list of artifacts.
Expand All @@ -2633,6 +2635,7 @@ def list_artifacts(
created=created,
updated=updated,
name=name,
has_custom_name=has_custom_name,
)
return self.zen_store.list_artifacts(artifact_filter_model)

Expand Down
3 changes: 2 additions & 1 deletion src/zenml/models/v2/core/artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,5 @@ def versions(self) -> Dict[str, "ArtifactVersionResponse"]:
class ArtifactFilter(BaseFilter):
"""Model to enable advanced filtering of artifacts."""

name: Optional[str]
name: Optional[str] = None
has_custom_name: Optional[bool] = None

0 comments on commit 5742120

Please sign in to comment.