diff --git a/CHANGELOG.md b/CHANGELOG.md index 1340b161b..56df818b5 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.55.3] - 2024-08-29 +### Fixed +- [Feature Preview - alpha] data workflows: `workflowExecutionId` in `cognite.client.data_classes.workflows.WorkflowTriggerRun` + can be null or missing, as according to the API spec. + ## [7.55.2] - 2024-08-29 ### Fixed - Turn workflow_orchestration into data_workflows and add trigger doc, fix attribute names in data classes diff --git a/cognite/client/_version.py b/cognite/client/_version.py index a2f3828ca..91c5894fd 100644 --- a/cognite/client/_version.py +++ b/cognite/client/_version.py @@ -1,4 +1,4 @@ from __future__ import annotations -__version__ = "7.55.2" +__version__ = "7.55.3" __api_subversion__ = "20230101" diff --git a/cognite/client/data_classes/workflows.py b/cognite/client/data_classes/workflows.py index 26f13eb6e..2e0f41d87 100644 --- a/cognite/client/data_classes/workflows.py +++ b/cognite/client/data_classes/workflows.py @@ -1385,8 +1385,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 @@ -1403,9 +1403,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: @@ -1419,8 +1420,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 f2c757338..0362498f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "cognite-sdk" -version = "7.55.2" +version = "7.55.3" description = "Cognite Python SDK" readme = "README.md" documentation = "https://cognite-sdk-python.readthedocs-hosted.com"