diff --git a/CHANGELOG.md b/CHANGELOG.md index ad71ae8dd..b49580bb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,11 @@ Changes are grouped as follows - `Fixed` for any bug fixes. - `Security` in case of vulnerabilities. +## [7.58.1] - 2024-09-03 +### Fixed +- [Feature Preview - beta] data workflows: `workflowExecutionId` in `cognite.client.data_classes.workflows.WorkflowTriggerRun` + can be null or missing, as according to the API spec. + ## [7.58.0] - 2024-09-03 ### Added - Data Workflows: add support for `SubworkflowReferenceParameters` subworkflow task type. Allowing embedding other workflows into a workflow. diff --git a/cognite/client/_version.py b/cognite/client/_version.py index 7034e995f..b4bf6d573 100644 --- a/cognite/client/_version.py +++ b/cognite/client/_version.py @@ -1,4 +1,4 @@ from __future__ import annotations -__version__ = "7.58.0" +__version__ = "7.58.1" __api_subversion__ = "20230101" diff --git a/cognite/client/data_classes/workflows.py b/cognite/client/data_classes/workflows.py index ad63526fc..efae89d72 100644 --- a/cognite/client/data_classes/workflows.py +++ b/cognite/client/data_classes/workflows.py @@ -1420,8 +1420,8 @@ def __init__( fire_time: int, workflow_external_id: str, workflow_version: str, - workflow_execution_id: str, status: Literal["success", "failed"], + workflow_execution_id: str | None = None, reason_for_failure: str | None = None, ) -> None: self.external_id = external_id @@ -1438,9 +1438,10 @@ def dump(self, camel_case: bool = True) -> dict[str, Any]: "fire_time": self.fire_time, "workflow_external_id": self.workflow_external_id, "workflow_version": self.workflow_version, - "workflow_execution_id": self.workflow_execution_id, "status": self.status, } + if self.workflow_execution_id: + item["workflow_execution_id"] = self.workflow_execution_id if self.reason_for_failure: item["reason_for_failure"] = self.reason_for_failure if camel_case: @@ -1454,8 +1455,8 @@ def _load(cls, resource: dict, cognite_client: CogniteClient | None = None) -> W fire_time=resource["fireTime"], workflow_external_id=resource["workflowExternalId"], workflow_version=resource["workflowVersion"], - workflow_execution_id=resource["workflowExecutionId"], status=resource["status"], + workflow_execution_id=resource.get("workflowExecutionId"), reason_for_failure=resource.get("reasonForFailure"), ) diff --git a/pyproject.toml b/pyproject.toml index aed8a0ceb..70327d822 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "cognite-sdk" -version = "7.58.0" +version = "7.58.1" description = "Cognite Python SDK" readme = "README.md" documentation = "https://cognite-sdk-python.readthedocs-hosted.com"