Skip to content

Commit

Permalink
Workflow Version missing overload (#2044)
Browse files Browse the repository at this point in the history
  • Loading branch information
doctrino authored Nov 23, 2024
1 parent 34a3338 commit a7aa775
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions cognite/client/_api/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,24 @@ def delete(
wrap_ids=True,
)

@overload
def retrieve(
self,
workflow_external_id: WorkflowVersionIdentifier | str,
version: str | None = None,
*,
ignore_unknown_ids: bool = False,
) -> WorkflowVersion | None: ...

@overload
def retrieve(
self,
workflow_external_id: Sequence[WorkflowVersionIdentifier] | WorkflowIds,
version: None = None,
*,
ignore_unknown_ids: bool = False,
) -> WorkflowVersionList: ...

def retrieve(
self,
workflow_external_id: WorkflowVersionIdentifier | Sequence[WorkflowVersionIdentifier] | WorkflowIds | str,
Expand Down
4 changes: 2 additions & 2 deletions tests/tests_integration/test_api/test_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,10 @@ def test_delete_non_existing(self, cognite_client: CogniteClient, new_workflow_v
],
ignore_unknown_ids=True,
)
assert cognite_client.workflows.versions.retrieve(*new_workflow_version.as_id().as_primitive()) is None
assert cognite_client.workflows.versions.retrieve(new_workflow_version.as_id().as_tuple()) is None

def test_retrieve_workflow(self, cognite_client: CogniteClient, new_workflow_version: WorkflowVersion) -> None:
retrieved = cognite_client.workflows.versions.retrieve(*new_workflow_version.as_id().as_primitive())
retrieved = cognite_client.workflows.versions.retrieve(new_workflow_version.as_id().as_tuple())
assert retrieved == new_workflow_version

def test_retrieve_non_existing_workflow(self, cognite_client: CogniteClient) -> None:
Expand Down

0 comments on commit a7aa775

Please sign in to comment.