From 774e0d965a7aa193edc7b7840df243b0607b52d7 Mon Sep 17 00:00:00 2001 From: Bert Verstraete Date: Tue, 11 Jun 2024 09:48:29 +0200 Subject: [PATCH] Update data workflows docs (#1802) - Remove dangling beta/alpha notices - Link to GA API spec instead of beta --- cognite/client/_api/workflows.py | 26 +++++++++++++------------- docs/source/workflow_orchestration.rst | 8 -------- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/cognite/client/_api/workflows.py b/cognite/client/_api/workflows.py index 16339fea2b..bf484cdd17 100644 --- a/cognite/client/_api/workflows.py +++ b/cognite/client/_api/workflows.py @@ -44,7 +44,7 @@ class WorkflowTaskAPI(APIClient): def update( self, task_id: str, status: Literal["completed", "failed"], output: dict | None = None ) -> WorkflowTaskExecution: - """`Update status of async task. `_ + """`Update status of async task. `_ For tasks that has been marked with 'is_async = True', the status must be updated by calling this endpoint with either 'completed' or 'failed'. @@ -93,7 +93,7 @@ class WorkflowExecutionAPI(APIClient): _RESOURCE_PATH = "/workflows/executions" def retrieve_detailed(self, id: str) -> WorkflowExecutionDetailed | None: - """`Retrieve a workflow execution with detailed information. `_ + """`Retrieve a workflow execution with detailed information. `_ Args: id (str): The server-generated id of the workflow execution. @@ -133,7 +133,7 @@ def trigger( metadata: dict | None = None, client_credentials: ClientCredentials | None = None, ) -> WorkflowExecution: - """`Trigger a workflow execution. `_ + """`Trigger a workflow execution. `_ Args: workflow_external_id (str): External id of the workflow. @@ -195,7 +195,7 @@ def list( statuses: WorkflowStatus | MutableSequence[WorkflowStatus] | None = None, limit: int = DEFAULT_LIMIT_READ, ) -> WorkflowExecutionList: - """`List workflow executions in the project. `_ + """`List workflow executions in the project. `_ Args: workflow_version_ids (WorkflowVersionIdentifier | MutableSequence[WorkflowVersionIdentifier] | None): Workflow version id or list of workflow version ids to filter on. @@ -247,7 +247,7 @@ def list( ) def cancel(self, id: str, reason: str | None) -> WorkflowExecution: - """`cancel a workflow execution. `_ + """`cancel a workflow execution. `_ Args: id (str): The server-generated id of the workflow execution. @@ -281,7 +281,7 @@ def cancel(self, id: str, reason: str | None) -> WorkflowExecution: return WorkflowExecution._load(response.json()) def retry(self, id: str, client_credentials: ClientCredentials | None = None) -> WorkflowExecution: - """`Retry a workflow execution. `_ + """`Retry a workflow execution. `_ Args: id (str): The server-generated id of the workflow execution. @@ -317,7 +317,7 @@ def __init__(self, config: ClientConfig, api_version: str | None, cognite_client self._DELETE_LIMIT = 100 def upsert(self, version: WorkflowVersionUpsert, mode: Literal["replace"] = "replace") -> WorkflowVersion: - """`Create a workflow version. `_ + """`Create a workflow version. `_ Note this is an upsert endpoint, so if a workflow with the same version external id already exists, it will be updated. @@ -370,7 +370,7 @@ def delete( workflow_version_id: WorkflowVersionIdentifier | MutableSequence[WorkflowVersionIdentifier], ignore_unknown_ids: bool = False, ) -> None: - """`Delete a workflow version(s). `_ + """`Delete a workflow version(s). `_ Args: workflow_version_id (WorkflowVersionIdentifier | MutableSequence[WorkflowVersionIdentifier]): Workflow version id or list of workflow version ids to delete. @@ -400,7 +400,7 @@ def delete( ) def retrieve(self, workflow_external_id: str, version: str) -> WorkflowVersion | None: - """`Retrieve a workflow version. `_ + """`Retrieve a workflow version. `_ Args: workflow_external_id (str): External id of the workflow. @@ -433,7 +433,7 @@ def list( workflow_version_ids: WorkflowIdentifier | MutableSequence[WorkflowIdentifier] | None = None, limit: int = DEFAULT_LIMIT_READ, ) -> WorkflowVersionList: - """`List workflow versions in the project `_ + """`List workflow versions in the project `_ Args: workflow_version_ids (WorkflowIdentifier | MutableSequence[WorkflowIdentifier] | None): Workflow version id or list of workflow version ids to filter on. @@ -494,7 +494,7 @@ def __init__( self._DELETE_LIMIT = 100 def upsert(self, workflow: WorkflowUpsert, mode: Literal["replace"] = "replace") -> Workflow: - """`Create a workflow. `_ + """`Create a workflow. `_ Note this is an upsert endpoint, so if a workflow with the same external id already exists, it will be updated. @@ -524,7 +524,7 @@ def upsert(self, workflow: WorkflowUpsert, mode: Literal["replace"] = "replace") return Workflow._load(response.json()["items"][0]) def retrieve(self, external_id: str) -> Workflow | None: - """`Retrieve a workflow. `_ + """`Retrieve a workflow. `_ Args: external_id (str): Identifier for a Workflow. Must be unique for the project. @@ -570,7 +570,7 @@ def delete(self, external_id: str | SequenceNotStr[str], ignore_unknown_ids: boo ) def list(self, limit: int = DEFAULT_LIMIT_READ) -> WorkflowList: - """`List all workflows in the project. `_ + """`List all workflows in the project. `_ Args: limit (int): Maximum number of results to return. Defaults to 25. Set to -1, float("inf") or None diff --git a/docs/source/workflow_orchestration.rst b/docs/source/workflow_orchestration.rst index 22d6c39f1e..aaba2cb209 100644 --- a/docs/source/workflow_orchestration.rst +++ b/docs/source/workflow_orchestration.rst @@ -1,14 +1,6 @@ Data Workflows ====================== -.. warning:: - Data Workflows is a new feature: - * The API specification is in beta. - * The SDK implementation is in alpha. - - Thus, breaking changes may occur without further notice, see :ref:`appendix-alpha-beta-features` for more information. - - Workflows ------------ Upsert Workflow