Skip to content

Commit e2d93f2

Browse files
authored
fix files/upload for files using geo_location (#1595)
1 parent 8e69b43 commit e2d93f2

File tree

5 files changed

+21
-13
lines changed

5 files changed

+21
-13
lines changed

CHANGELOG.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,29 @@ Changes are grouped as follows
1717
- `Fixed` for any bug fixes.
1818
- `Security` in case of vulnerabilities.
1919

20+
## [7.13.8] - 2024-01-19
21+
### Fixed
22+
- `FilesAPI.upload` when using `geo_location` (serialize error).
23+
2024
## [7.13.7] - 2024-01-19
2125
### Fixed
22-
* Type hints for all `.update` and `.upsert` methods accept Write classes in addition to Read and Update classes.
23-
* Missing overloading of the `.update` methods on `client.three_d.models.update`, `client.transformations.update`,
26+
- Type hints for all `.update` and `.upsert` methods accept Write classes in addition to Read and Update classes.
27+
- Missing overloading of the `.update` methods on `client.three_d.models.update`, `client.transformations.update`,
2428
`client.transformations.schedules.update`, `client.relationships.update`, and `client.data_sets.update`.
2529

2630
## [7.13.6] - 2024-01-18
2731
### Added
28-
- Helper method `as_tuple` to `NodeId` and `EdgeId`.
32+
- Helper method `as_tuple` to `NodeId` and `EdgeId`.
2933

3034
## [7.13.5] - 2024-01-16
3135
### Added
32-
- EdgeConnection, MultiEdgeConnection, MultiReverseDirectRelation and their corresponding Apply View dataclasses are now importable from `cognite.client.dataclasses.data_modeling`.
36+
- EdgeConnection, MultiEdgeConnection, MultiReverseDirectRelation and their corresponding Apply View dataclasses are now importable from `cognite.client.dataclasses.data_modeling`.
3337

3438
## [7.13.4] - 2024-01-11
3539
### Fixed
36-
* When calling `WorkflowExecution.load` not having a `schedule` would raise a `KeyError` even though it is optional. This is now fixed.
37-
* When calling `Datapoints.load` not having a `isString` would raise a `KeyError` even though it is optional. This is now fixed.
38-
* Most `CogniteResourceList.as_write()` would raise a `CogniteMissingClientError` when called from a class with missing cognite_client. This is now fixed.
40+
- When calling `WorkflowExecution.load` not having a `schedule` would raise a `KeyError` even though it is optional. This is now fixed.
41+
- When calling `Datapoints.load` not having a `isString` would raise a `KeyError` even though it is optional. This is now fixed.
42+
- Most `CogniteResourceList.as_write()` would raise a `CogniteMissingClientError` when called from a class with missing cognite_client. This is now fixed.
3943

4044
## [7.13.3] - 2024-01-12
4145
### Added
@@ -44,7 +48,7 @@ Changes are grouped as follows
4448

4549
## [7.13.2] - 2024-01-11
4650
### Fixed
47-
* When calling `ExtractinoPipeline.load` not having a `schedule` would raise a `KeyError` even though it is optional. This is now fixed.
51+
- When calling `ExtractinoPipeline.load` not having a `schedule` would raise a `KeyError` even though it is optional. This is now fixed.
4852

4953
## [7.13.1] - 2024-01-10
5054
### Improved

cognite/client/_api/raw.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,8 @@ def insert(
384384
>>> from cognite.client import CogniteClient
385385
>>> from cognite.client.data_classes import RowWrite
386386
>>> c = CogniteClient()
387-
>>> rows = [RowWrite(key="r1", columns={"col1": "val1", "col2": "val1"}), RowWrite(key="r2", columns={"col1": "val2", "col2": "val2"})]
387+
>>> rows = [RowWrite(key="r1", columns={"col1": "val1", "col2": "val1"}),
388+
... RowWrite(key="r2", columns={"col1": "val2", "col2": "val2"})]
388389
>>> c.raw.rows.insert("db1", "table1", rows)
389390
"""
390391
chunks = self._process_row_input(row)

cognite/client/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from __future__ import annotations
22

3-
__version__ = "7.13.7"
3+
__version__ = "7.13.8"
44
__api_subversion__ = "V20220125"

cognite/client/data_classes/files.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,11 @@ def __init__(
6060
source_modified_time: int | None = None,
6161
security_categories: Sequence[int] | None = None,
6262
) -> None:
63-
if geo_location is not None and not isinstance(geo_location, GeoLocation):
64-
raise TypeError("FileMetadata.geo_location should be of type GeoLocation")
63+
if geo_location is not None:
64+
if isinstance(geo_location, dict):
65+
geo_location = GeoLocation.load(geo_location)
66+
if not isinstance(geo_location, GeoLocation):
67+
raise TypeError("FileMetadata.geo_location should be of type GeoLocation")
6568
self.external_id = external_id
6669
self.name = name
6770
self.directory = directory

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tool.poetry]
22
name = "cognite-sdk"
33

4-
version = "7.13.7"
4+
version = "7.13.8"
55
description = "Cognite Python SDK"
66
readme = "README.md"
77
documentation = "https://cognite-sdk-python.readthedocs-hosted.com"

0 commit comments

Comments
 (0)