From f716981fdeda231528062c9e8cdb0f61fd77dda7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20V=2E=20Treider?= Date: Thu, 9 Nov 2023 18:17:00 +0100 Subject: [PATCH] Fix unit conversion for self-splitting datapoints tasks (#1488) --- CHANGELOG.md | 7 ++++++- cognite/client/_api/datapoint_tasks.py | 4 ++++ cognite/client/_version.py | 2 +- pyproject.toml | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83158a05a..14d4bcca3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,9 +17,14 @@ Changes are grouped as follows - `Fixed` for any bug fixes. - `Security` in case of vulnerabilities. +## [6.39.4] - 2023-11-09 +## Fixed +- Fetching datapoints from dense time series using a `targetUnit` or a target `targetUnitSystem` could result + in some batches not being converted to the new unit. + ## [6.39.3] - 2023-11-08 ## Fixed -- The newely introduced parameter `connectionType` was assumed to be required from the API. This is not the case. +- The newely introduced parameter `connectionType` was assumed to be required from the API. This is not the case. ## [6.39.2] - 2023-11-08 ## Fixed diff --git a/cognite/client/_api/datapoint_tasks.py b/cognite/client/_api/datapoint_tasks.py index ad3596131..0a275aa3c 100644 --- a/cognite/client/_api/datapoint_tasks.py +++ b/cognite/client/_api/datapoint_tasks.py @@ -646,6 +646,8 @@ def __init__( self.parent = parent self.is_raw_query = is_raw_query self.max_query_limit = max_query_limit + self.target_unit = target_unit + self.target_unit_system = target_unit_system self.is_done = False self.static_kwargs = identifier.as_dict() @@ -763,6 +765,8 @@ def _static_params(self) -> dict[str, Any]: granularity=self.granularity, max_query_limit=self.max_query_limit, is_raw_query=self.is_raw_query, + target_unit=self.target_unit, + target_unit_system=self.target_unit_system, ) def store_partial_result(self, res: DataPointListItem) -> list[SplittingFetchSubtask] | None: diff --git a/cognite/client/_version.py b/cognite/client/_version.py index abad9454d..d848f4052 100644 --- a/cognite/client/_version.py +++ b/cognite/client/_version.py @@ -1,4 +1,4 @@ from __future__ import annotations -__version__ = "6.39.3" +__version__ = "6.39.4" __api_subversion__ = "V20220125" diff --git a/pyproject.toml b/pyproject.toml index 526c57716..484c582e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "cognite-sdk" -version = "6.39.3" +version = "6.39.4" description = "Cognite Python SDK" readme = "README.md" documentation = "https://cognite-sdk-python.readthedocs-hosted.com"