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

Allow filtering artifacts with/without custom names #2226

Merged
merged 3 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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
Loading