Skip to content

Commit

Permalink
fix: Bug in transformation init method (#1527)
Browse files Browse the repository at this point in the history
  • Loading branch information
doctrino authored Nov 28, 2023
1 parent f4c00fe commit c84e158
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 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.4.1] - 2023-11-28
### Fixed
- Error in logic when creating a `Transformation`. This is causing when calling `client.transformations.update`.
This is now fixed.

## [7.4.0] - 2023-11-27
### Changed
- Unit Catalog API is out of beta and will no longer issue warnings on usage. Access is unchanged: `client.units`.
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.4.0"
__version__ = "7.4.1"
__api_subversion__ = "V20220125"
4 changes: 2 additions & 2 deletions cognite/client/data_classes/transformations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ def __init__(
raise ValueError("Transformation external_id must be the same as the schedule.external_id.")
if (
(self.schedule and self.id != self.schedule.id)
or (self.running_job and self.id != self.running_job.id)
or (self.last_finished_job and self.id != self.last_finished_job.id)
or (self.running_job and self.id != self.running_job.transformation_id)
or (self.last_finished_job and self.id != self.last_finished_job.transformation_id)
):
raise ValueError("Transformation id must be the same as the schedule, running_job, last_running_job id.")

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.4.0"
version = "7.4.1"
description = "Cognite Python SDK"
readme = "README.md"
documentation = "https://cognite-sdk-python.readthedocs-hosted.com"
Expand Down
4 changes: 2 additions & 2 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ def create_instance(self, resource_cls: type[T_Object]) -> T_Object:
# schedule and jobs must match external id and id
keyword_arguments["schedule"].external_id = keyword_arguments["external_id"]
keyword_arguments["schedule"].id = keyword_arguments["id"]
keyword_arguments["running_job"].id = keyword_arguments["id"]
keyword_arguments["last_finished_job"].id = keyword_arguments["id"]
keyword_arguments["running_job"].transformation_id = keyword_arguments["id"]
keyword_arguments["last_finished_job"].transformation_id = keyword_arguments["id"]
return resource_cls(*positional_arguments, **keyword_arguments)

def create_value(self, type_: Any, var_name: str | None = None) -> Any:
Expand Down

0 comments on commit c84e158

Please sign in to comment.