Skip to content

Commit

Permalink
allow None for workflowExecutionId in WorkflowTriggerRun
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-cognite committed Sep 2, 2024
1 parent 95178fd commit 99ad123
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.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
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.55.2"
__version__ = "7.55.3"
__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 @@ -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
Expand All @@ -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:
Expand All @@ -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"),
)

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.55.2"
version = "7.55.3"
description = "Cognite Python SDK"
readme = "README.md"
documentation = "https://cognite-sdk-python.readthedocs-hosted.com"
Expand Down

0 comments on commit 99ad123

Please sign in to comment.