Skip to content

Commit

Permalink
fixing the failing cli integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bcdurak committed Dec 2, 2024
1 parent 7751abf commit e60bd68
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
46 changes: 44 additions & 2 deletions src/zenml/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1702,6 +1702,7 @@ def list_services(
updated: Optional[datetime] = None,
type: Optional[str] = None,
flavor: Optional[str] = None,
user: Optional[Union[UUID, str]] = None,
workspace_id: Optional[Union[str, UUID]] = None,
user_id: Optional[Union[str, UUID]] = None,
hydrate: bool = False,
Expand All @@ -1727,6 +1728,7 @@ def list_services(
flavor: Use the service flavor for filtering
workspace_id: The id of the workspace to filter by.
user_id: The id of the user to filter by.
user: Filter by user name/ID.
hydrate: Flag deciding whether to hydrate the output model(s)
by including metadata fields in the response.
running: Use the running status for filtering
Expand All @@ -1753,6 +1755,7 @@ def list_services(
flavor=flavor,
workspace_id=workspace_id,
user_id=user_id,
user=user,
running=running,
name=service_name,
pipeline_name=pipeline_name,
Expand Down Expand Up @@ -2249,6 +2252,7 @@ def list_flavors(
type: Optional[str] = None,
integration: Optional[str] = None,
user_id: Optional[Union[str, UUID]] = None,
user: Optional[Union[UUID, str]] = None,
hydrate: bool = False,
) -> Page[FlavorResponse]:
"""Fetches all the flavor models.
Expand All @@ -2262,6 +2266,7 @@ def list_flavors(
created: Use to flavors by time of creation
updated: Use the last updated date for filtering
user_id: The id of the user to filter by.
user: Filter by user name/ID.
name: The name of the flavor to filter by.
type: The type of the flavor to filter by.
integration: The integration of the flavor to filter by.
Expand All @@ -2277,6 +2282,7 @@ def list_flavors(
sort_by=sort_by,
logical_operator=logical_operator,
user_id=user_id,
user=user,
name=name,
type=type,
integration=integration,
Expand Down Expand Up @@ -2661,6 +2667,7 @@ def list_builds(
updated: Optional[Union[datetime, str]] = None,
workspace_id: Optional[Union[str, UUID]] = None,
user_id: Optional[Union[str, UUID]] = None,
user: Optional[Union[UUID, str]] = None,
pipeline_id: Optional[Union[str, UUID]] = None,
stack_id: Optional[Union[str, UUID]] = None,
is_local: Optional[bool] = None,
Expand All @@ -2682,6 +2689,7 @@ def list_builds(
updated: Use the last updated date for filtering
workspace_id: The id of the workspace to filter by.
user_id: The id of the user to filter by.
user: Filter by user name/ID.
pipeline_id: The id of the pipeline to filter by.
stack_id: The id of the stack to filter by.
is_local: Use to filter local builds.
Expand All @@ -2705,6 +2713,7 @@ def list_builds(
updated=updated,
workspace_id=workspace_id,
user_id=user_id,
user=user,
pipeline_id=pipeline_id,
stack_id=stack_id,
is_local=is_local,
Expand Down Expand Up @@ -2771,7 +2780,7 @@ def get_event_source(
allow_name_prefix_match: bool = True,
hydrate: bool = True,
) -> EventSourceResponse:
"""Get a event source by name, ID or prefix.
"""Get an event source by name, ID or prefix.
Args:
name_id_or_prefix: The name, ID or prefix of the stack.
Expand Down Expand Up @@ -2804,6 +2813,7 @@ def list_event_sources(
event_source_type: Optional[str] = None,
workspace_id: Optional[Union[str, UUID]] = None,
user_id: Optional[Union[str, UUID]] = None,
user: Optional[Union[UUID, str]] = None,
hydrate: bool = False,
) -> Page[EventSourceResponse]:
"""Lists all event_sources.
Expand All @@ -2818,6 +2828,7 @@ def list_event_sources(
updated: Use the last updated date for filtering
workspace_id: The id of the workspace to filter by.
user_id: The id of the user to filter by.
user: Filter by user name/ID.
name: The name of the event_source to filter by.
flavor: The flavor of the event_source to filter by.
event_source_type: The subtype of the event_source to filter by.
Expand All @@ -2834,6 +2845,7 @@ def list_event_sources(
logical_operator=logical_operator,
workspace_id=workspace_id,
user_id=user_id,
user=user,
name=name,
flavor=flavor,
plugin_subtype=event_source_type,
Expand Down Expand Up @@ -3001,6 +3013,7 @@ def list_actions(
action_type: Optional[str] = None,
workspace_id: Optional[Union[str, UUID]] = None,
user_id: Optional[Union[str, UUID]] = None,
user: Optional[Union[UUID, str]] = None,
hydrate: bool = False,
) -> Page[ActionResponse]:
"""List actions.
Expand All @@ -3015,6 +3028,7 @@ def list_actions(
updated: Use the last updated date for filtering
workspace_id: The id of the workspace to filter by.
user_id: The id of the user to filter by.
user: Filter by user name/ID.
name: The name of the action to filter by.
flavor: The flavor of the action to filter by.
action_type: The type of the action to filter by.
Expand All @@ -3031,6 +3045,7 @@ def list_actions(
logical_operator=logical_operator,
workspace_id=workspace_id,
user_id=user_id,
user=user,
name=name,
id=id,
flavor=flavor,
Expand Down Expand Up @@ -3179,6 +3194,7 @@ def list_triggers(
action_subtype: Optional[str] = None,
workspace_id: Optional[Union[str, UUID]] = None,
user_id: Optional[Union[str, UUID]] = None,
user: Optional[Union[UUID, str]] = None,
hydrate: bool = False,
) -> Page[TriggerResponse]:
"""Lists all triggers.
Expand All @@ -3193,6 +3209,7 @@ def list_triggers(
updated: Use the last updated date for filtering
workspace_id: The id of the workspace to filter by.
user_id: The id of the user to filter by.
user: Filter by user name/ID.
name: The name of the trigger to filter by.
event_source_id: The event source associated with the trigger.
action_id: The action associated with the trigger.
Expand All @@ -3215,6 +3232,7 @@ def list_triggers(
logical_operator=logical_operator,
workspace_id=workspace_id,
user_id=user_id,
user=user,
name=name,
event_source_id=event_source_id,
action_id=action_id,
Expand Down Expand Up @@ -3365,6 +3383,7 @@ def list_deployments(
updated: Optional[Union[datetime, str]] = None,
workspace_id: Optional[Union[str, UUID]] = None,
user_id: Optional[Union[str, UUID]] = None,
user: Optional[Union[UUID, str]] = None,
pipeline_id: Optional[Union[str, UUID]] = None,
stack_id: Optional[Union[str, UUID]] = None,
build_id: Optional[Union[str, UUID]] = None,
Expand All @@ -3383,6 +3402,7 @@ def list_deployments(
updated: Use the last updated date for filtering
workspace_id: The id of the workspace to filter by.
user_id: The id of the user to filter by.
user: Filter by user name/ID.
pipeline_id: The id of the pipeline to filter by.
stack_id: The id of the stack to filter by.
build_id: The id of the build to filter by.
Expand All @@ -3403,6 +3423,7 @@ def list_deployments(
updated=updated,
workspace_id=workspace_id,
user_id=user_id,
user=user,
pipeline_id=pipeline_id,
stack_id=stack_id,
build_id=build_id,
Expand Down Expand Up @@ -3650,6 +3671,7 @@ def list_schedules(
name: Optional[str] = None,
workspace_id: Optional[Union[str, UUID]] = None,
user_id: Optional[Union[str, UUID]] = None,
user: Optional[Union[UUID, str]] = None,
pipeline_id: Optional[Union[str, UUID]] = None,
orchestrator_id: Optional[Union[str, UUID]] = None,
active: Optional[Union[str, bool]] = None,
Expand All @@ -3674,6 +3696,7 @@ def list_schedules(
name: The name of the stack to filter by.
workspace_id: The id of the workspace to filter by.
user_id: The id of the user to filter by.
user: Filter by user name/ID.
pipeline_id: The id of the pipeline to filter by.
orchestrator_id: The id of the orchestrator to filter by.
active: Use to filter by active status.
Expand All @@ -3700,6 +3723,7 @@ def list_schedules(
name=name,
workspace_id=workspace_id,
user_id=user_id,
user=user,
pipeline_id=pipeline_id,
orchestrator_id=orchestrator_id,
active=active,
Expand Down Expand Up @@ -3940,6 +3964,7 @@ def list_run_steps(
original_step_run_id: Optional[Union[str, UUID]] = None,
workspace_id: Optional[Union[str, UUID]] = None,
user_id: Optional[Union[str, UUID]] = None,
user: Optional[Union[UUID, str]] = None,
model_version_id: Optional[Union[str, UUID]] = None,
model: Optional[Union[UUID, str]] = None,
hydrate: bool = False,
Expand All @@ -3958,6 +3983,7 @@ def list_run_steps(
end_time: Use to filter by the time when the step finished running
workspace_id: The id of the workspace to filter by.
user_id: The id of the user to filter by.
user: Filter by user name/ID.
pipeline_run_id: The id of the pipeline run to filter by.
deployment_id: The id of the deployment to filter by.
original_step_run_id: The id of the original step run to filter by.
Expand Down Expand Up @@ -3992,6 +4018,7 @@ def list_run_steps(
name=name,
workspace_id=workspace_id,
user_id=user_id,
user=user,
model_version_id=model_version_id,
model=model,
)
Expand Down Expand Up @@ -4664,6 +4691,7 @@ def list_secrets(
scope: Optional[SecretScope] = None,
workspace_id: Optional[Union[str, UUID]] = None,
user_id: Optional[Union[str, UUID]] = None,
user: Optional[Union[UUID, str]] = None,
hydrate: bool = False,
) -> Page[SecretResponse]:
"""Fetches all the secret models.
Expand All @@ -4683,6 +4711,7 @@ def list_secrets(
scope: The scope of the secret to filter by.
workspace_id: The id of the workspace to filter by.
user_id: The id of the user to filter by.
user: Filter by user name/ID.
hydrate: Flag deciding whether to hydrate the output model(s)
by including metadata fields in the response.
Expand All @@ -4699,6 +4728,7 @@ def list_secrets(
sort_by=sort_by,
logical_operator=logical_operator,
user_id=user_id,
user=user,
workspace_id=workspace_id,
name=name,
scope=scope,
Expand Down Expand Up @@ -5013,6 +5043,7 @@ def list_code_repositories(
name: Optional[str] = None,
workspace_id: Optional[Union[str, UUID]] = None,
user_id: Optional[Union[str, UUID]] = None,
user: Optional[Union[UUID, str]] = None,
hydrate: bool = False,
) -> Page[CodeRepositoryResponse]:
"""List all code repositories.
Expand All @@ -5028,6 +5059,7 @@ def list_code_repositories(
name: The name of the code repository to filter by.
workspace_id: The id of the workspace to filter by.
user_id: The id of the user to filter by.
user: Filter by user name/ID.
hydrate: Flag deciding whether to hydrate the output model(s)
by including metadata fields in the response.
Expand All @@ -5045,6 +5077,7 @@ def list_code_repositories(
name=name,
workspace_id=workspace_id,
user_id=user_id,
user=user,
)
filter_model.set_scope_workspace(self.active_workspace.id)
return self.zen_store.list_code_repositories(
Expand Down Expand Up @@ -5405,6 +5438,7 @@ def list_service_connectors(
resource_id: Optional[str] = None,
workspace_id: Optional[Union[str, UUID]] = None,
user_id: Optional[Union[str, UUID]] = None,
user: Optional[Union[UUID, str]] = None,
labels: Optional[Dict[str, Optional[str]]] = None,
secret_id: Optional[Union[str, UUID]] = None,
hydrate: bool = False,
Expand All @@ -5427,6 +5461,7 @@ def list_service_connectors(
they can give access to.
workspace_id: The id of the workspace to filter by.
user_id: The id of the user to filter by.
user: Filter by user name/ID.
name: The name of the service connector to filter by.
labels: The labels of the service connector to filter by.
secret_id: Filter by the id of the secret that is referenced by the
Expand All @@ -5444,6 +5479,7 @@ def list_service_connectors(
logical_operator=logical_operator,
workspace_id=workspace_id or self.active_workspace.id,
user_id=user_id,
user=user,
name=name,
connector_type=connector_type,
auth_method=auth_method,
Expand Down Expand Up @@ -6596,6 +6632,7 @@ def list_authorized_devices(
client_id: Union[UUID, str, None] = None,
status: Union[OAuthDeviceStatus, str, None] = None,
trusted_device: Union[bool, str, None] = None,
user: Optional[Union[UUID, str]] = None,
failed_auth_attempts: Union[int, str, None] = None,
last_login: Optional[Union[datetime, str, None]] = None,
hydrate: bool = False,
Expand All @@ -6613,6 +6650,7 @@ def list_authorized_devices(
expires: Use the expiration date for filtering.
client_id: Use the client id for filtering.
status: Use the status for filtering.
user: Filter by user name/ID.
trusted_device: Use the trusted device flag for filtering.
failed_auth_attempts: Use the failed auth attempts for filtering.
last_login: Use the last login date for filtering.
Expand All @@ -6632,6 +6670,7 @@ def list_authorized_devices(
updated=updated,
expires=expires,
client_id=client_id,
user=user,
status=status,
trusted_device=trusted_device,
failed_auth_attempts=failed_auth_attempts,
Expand Down Expand Up @@ -6730,7 +6769,7 @@ def get_trigger_execution(
trigger_execution_id: UUID,
hydrate: bool = True,
) -> TriggerExecutionResponse:
"""Get an trigger execution by ID.
"""Get a trigger execution by ID.
Args:
trigger_execution_id: The ID of the trigger execution to get.
Expand All @@ -6751,6 +6790,7 @@ def list_trigger_executions(
size: int = PAGE_SIZE_DEFAULT,
logical_operator: LogicalOperators = LogicalOperators.AND,
trigger_id: Optional[UUID] = None,
user: Optional[Union[UUID, str]] = None,
hydrate: bool = False,
) -> Page[TriggerExecutionResponse]:
"""List all trigger executions matching the given filter criteria.
Expand All @@ -6761,6 +6801,7 @@ def list_trigger_executions(
size: The maximum size of all pages.
logical_operator: Which logical operator to use [and, or].
trigger_id: ID of the trigger to filter by.
user: Filter by user name/ID.
hydrate: Flag deciding whether to hydrate the output model(s)
by including metadata fields in the response.
Expand All @@ -6772,6 +6813,7 @@ def list_trigger_executions(
sort_by=sort_by,
page=page,
size=size,
user=user,
logical_operator=logical_operator,
)
filter_model.set_scope_workspace(self.active_workspace.id)
Expand Down
1 change: 1 addition & 0 deletions src/zenml/models/v2/base/scoped.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ class WorkspaceScopedFilter(UserScopedFilter):
CLI_EXCLUDE_FIELDS: ClassVar[List[str]] = [
*UserScopedFilter.CLI_EXCLUDE_FIELDS,
"workspace_id",
"workspace",
"scope_workspace",
]
CUSTOM_SORTING_OPTIONS: ClassVar[List[str]] = [
Expand Down

0 comments on commit e60bd68

Please sign in to comment.