Skip to content

Commit

Permalink
fix(workflows): support None value for simulation input unit override (
Browse files Browse the repository at this point in the history
  • Loading branch information
polomani authored Dec 4, 2024
1 parent 126d0c9 commit 688b956
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ Changes are grouped as follows
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.

## [7.70.1] - 2024-12-04
### Fixed
- Fix `workflows.executions.retrieve_detailed` type for `SimulationInputOverride` to allow for `None` value for `unit`.

## [7.70.0] - 2024-12-02
### Added
Expand Down
2 changes: 1 addition & 1 deletion cognite/client/_version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import annotations

__version__ = "7.70.0"
__version__ = "7.70.1"

__api_subversion__ = "20230101"
2 changes: 1 addition & 1 deletion cognite/client/data_classes/simulators/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def _load(cls, resource: dict[str, Any], cognite_client: CogniteClient | None =
return cls(
reference_id=resource["referenceId"],
value=resource["value"],
unit=SimulationValueUnitName._load(resource["unit"], cognite_client) if "unit" in resource else None,
unit=SimulationValueUnitName._load(resource["unit"], cognite_client) if resource.get("unit") else None,
)

def __post_init__(self) -> None:
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.70.0"
version = "7.70.1"

description = "Cognite Python SDK"
readme = "README.md"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ def get_workflow_seed_data(data_set_id: int, file_id: int):
"valueType": "DOUBLE",
"unit": {"name": "C", "quantity": "temperature"},
},
{
"name": "Hot Water Temperature",
"referenceId": "HWT",
"value": 1.0,
"valueType": "DOUBLE",
"unit": {"name": "C", "quantity": "temperature"},
},
],
"outputs": [
{
Expand Down
3 changes: 2 additions & 1 deletion tests/tests_integration/test_api/test_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ def test_upsert_run_delete_with_simulation_task(
inputs=[
SimulationInputOverride(
reference_id="CWT", value=11, unit=SimulationValueUnitName(name="F")
)
),
SimulationInputOverride(reference_id="HWT", value=0.1),
],
),
timeout=100,
Expand Down

0 comments on commit 688b956

Please sign in to comment.