Skip to content

Commit

Permalink
allow None for workflowExecutionId in WorkflowTriggerRun (#1903)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-cognite authored Sep 3, 2024
1 parent 2fa0318 commit 02e4305
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cognite/client/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from __future__ import annotations

__version__ = "7.58.0"
__version__ = "7.58.1"
__api_subversion__ = "20230101"
7 changes: 4 additions & 3 deletions cognite/client/data_classes/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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"),
)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 02e4305

Please sign in to comment.