From 2c3067c2433816181da98da9db3262eeaac26441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20V=2E=20Treider?= Date: Mon, 30 Oct 2023 12:46:42 +0100 Subject: [PATCH] changelog and migration guide entries --- CHANGELOG.md | 5 +++++ MIGRATION_GUIDE.md | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96438b125b..37499219f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ methods are `json` and `yaml` serializable. - `CogniteResource.to_pandas` and `CogniteResourceList.to_pandas` now converts known timestamps to `datetime` by default. Can be turned off with the new parameter `convert_timestamps`. Note: To comply with older pandas v1, the dtype will always be `datetime64[ns]`, although in v2 this could have been `datetime64[ms]`. +- `CogniteImportError` can now be caught as `ImportError`. ### Deprecated - The Templates API (migrate to Data Modeling). @@ -38,6 +39,10 @@ with no easy way to add a prefix. Also, it no longer expands metadata by default - Additionally, `Asset.to_pandas`, now accepts the parameters `expand_aggregates` and `aggregates_prefix`. Since the possible `aggregates` keys are known, `camel_case` will also apply to these (if expanded) as opposed to the metadata keys. +- More narrow exception types like `CogniteNotFoundError` and `CogniteDuplicatedError` are now raised instead of + `CogniteAPIError` for the following methods: `DatapointsAPI.retrieve_latest`, `RawRowsAPI.list`, + `RelationshipsAPI.list`, `SequencesDataAPI.retrieve`, `SyntheticDatapointsAPI.query`. Additionally, all calls + using `partitions` to API methods like `list` (or the generator version) now do the same. - The `CogniteResource._load` has been made public, i.e., it is now `CogniteResource.load`. - The `CogniteResourceList._load` has been made public, i.e., it is now `CogniteResourceList.load`. - All `.delete` and `.retrieve_multiple` methods now accepts an empty sequence, and will return an empty `CogniteResourceList`. diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md index e2142ed2ab..f1f2c4d1df 100644 --- a/MIGRATION_GUIDE.md +++ b/MIGRATION_GUIDE.md @@ -50,6 +50,10 @@ Changes are grouped as follows: ### Changed - All `assert`s meant for the SDK user, now raise appropriate errors instead (`ValueError`, `RuntimeError`...). - `CogniteAssetHierarchyError` is no longer possible to catch as an `AssertionError`. +- More narrow exception types like `CogniteNotFoundError` and `CogniteDuplicatedError` are now raised instead of + `CogniteAPIError` for the following methods: `DatapointsAPI.retrieve_latest`, `RawRowsAPI.list`, + `RelationshipsAPI.list`, `SequencesDataAPI.retrieve`, `SyntheticDatapointsAPI.query`. Additionally, all calls + using `partitions` to API methods like `list` (or the generator version) now do the same. - Several methods in the data modelling APIs have had parameter names now correctly reflect whether they accept a single or multiple items (i.e. id -> ids). - Loading `ObjectDetection` attributes `.attributes`, `.bounding_box`, `.polygon` and @@ -83,6 +87,9 @@ Changes are grouped as follows: - The attribute `columns` in `Sequence` has been changed from `SequenceType[dict]` to `SequnceColumnList`. -The class `SequenceRows` in `client.data_classes.transformations.common` has been renamed to `SequenceRowsDestination`. +### Optional +- `CogniteImportError` can now be caught as `ImportError`. + ## From v5 to v6 ### Removed - Removed support for legacy auth (API keys, service accounts, client.login.status()). Use OIDC to authenticate instead and use `client.iam.token.inspect()` instead of `login.status()`.