Skip to content

Commit 8923004

Browse files
committed
WIP Cursor wrote migration guide
1 parent 2142f74 commit 8923004

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

MIGRATION_GUIDE.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,61 @@ Changes are grouped as follows:
1111

1212
## From v7 to v8
1313

14+
### Dependency
15+
- **httpx**: The SDK now uses `httpx` instead of `requests` for HTTP operations. This is a required dependency.
16+
- **anyio**: Added as a required dependency (used by httpx, replaces pytest-asyncio).
17+
18+
### Functionality
19+
- **Async Support**: The SDK now provides full async support. The main client is now `AsyncCogniteClient` (previously `CogniteClient`), and a new synchronous `CogniteClient` is available for backward compatibility.
20+
- **HTTP Client**: All HTTP operations now use `httpx.AsyncClient` instead of `requests`.
21+
- **DataFrames**: Datapoints DataFrames now use MultiIndex columns for better organization of aggregate data.
22+
- **File Handling**: FilesAPI now prefers `pathlib.Path` objects over strings (though string support is maintained).
23+
- **JSON Serialization**: The SDK now uses compact JSON encoding for better performance.
24+
25+
### Removed
26+
- **Deprecated Aggregate Methods**: Removed deprecated `aggregate` methods from AssetsAPI, EventsAPI, SequencesAPI, and TimeSeriesAPI. Use `aggregate_count` instead.
27+
- **Deprecated Filter Methods**: Removed deprecated filter methods from various APIs.
28+
- **Deprecated Data Classes**:
29+
- `CountAggregate` class removed
30+
- `DataPointSubscriptionCreate` class removed
31+
- `SequenceData` class replaced by `SequenceRows` (old class still available for backward compatibility)
32+
- **Deprecated Methods**:
33+
- `DatapointsArray.__iter__` method removed
34+
- `CogniteObject.load_yaml` method on Query removed
35+
- `DataModelingInstancesList.get` method no longer accepts deprecated `id` argument
36+
- All `__iter__` methods removed from API classes
37+
- **Legacy Attributes**:
38+
- `legacy_name` attribute removed from time series data classes
39+
- `expected_fields` parameter removed from `Datapoints._load`
40+
- **Pyodide Handling**: Removed special pyodide handling in FilesAPI upload operations.
41+
42+
### Function Signature
43+
- **Client Rename**: `CogniteClient` is now `AsyncCogniteClient`. A new synchronous `CogniteClient` is available.
44+
- **Sequence Data**: `client.sequences.data.retrieve_latest` renamed to `client.sequences.data.retrieve_last_row`.
45+
- **Data Modeling**: `expand_properties` parameter in `to_pandas` methods now defaults to `True` for data modeling classes.
46+
- **File Paths**: FilesAPI methods now prefer `pathlib.Path` objects but still accept strings.
47+
48+
### Changed
49+
- **API Organization**: Many APIs have been split into separate files (Java-style organization):
50+
- Functions API split into `functions/` directory
51+
- IAM API split into `iam/` directory
52+
- Raw API split into `raw/` directory
53+
- 3D API split into `three_d/` directory
54+
- Workflows API split into `workflows/` directory
55+
- **Query Classes**: Query and sync classes have been split into separate dataclasses.
56+
- **Filter Classes**: Filter classes now have magic `__eq__` method for better usability.
57+
- **Data Classes**: Various data classes have been updated with new attributes and methods.
58+
- **Exception Handling**: New exception types added (e.g., `CogniteOrganizationError`, `CogniteModelFailedError`).
59+
60+
### Optional
61+
- **New APIs**: Several new APIs have been added:
62+
- Agents API for AI agent functionality
63+
- Simulators API for simulation operations
64+
- Document Preview API
65+
- Space Statistics API
66+
- **New Data Classes**: Many new data classes added for new features like agents, simulators, and enhanced data modeling.
67+
- **Enhanced Capabilities**: New ACL capabilities added for Streams, Records, and AppConfig.
68+
1469
## From v6 to v7
1570
### Functionality
1671
- `CogniteResource.to_pandas` and `CogniteResourceList.to_pandas` now converts known timestamps to `datetime` by

0 commit comments

Comments
 (0)