Skip to content

Conversation

andeplane
Copy link
Contributor

@andeplane andeplane commented Sep 8, 2025

MOST LIKELY TO CLOSE, BUT CURSOR BACKGROUND AGENTS DID ALL THIS.

Description

This PR introduces foundational asynchronous capabilities to the Cognite SDK. The primary goal is to enable improved performance and scalability through non-blocking I/O, while ensuring full backward compatibility for existing synchronous applications.

This is achieved by:

  1. Introducing AsyncCogniteClient: A new, pure async client built on httpx for efficient concurrent operations.
  2. Refactoring CogniteClient: The existing CogniteClient now acts as a synchronous wrapper around AsyncCogniteClient, using asyncio.run() to maintain its original interface and behavior.
  3. Converting Core Infrastructure: The underlying HTTP client, base API client, and concurrency utilities (execute_tasks_async) have been converted to support async patterns.

This establishes a robust async foundation, ready for the incremental conversion of individual API resources.

Checklist:

  • Tests added/updated.
  • Documentation updated. Documentation is generated from docstrings - these must be updated according to your change.
    If a new method has been added it should be referenced in cognite.rst in order to generate docs based on its docstring.
  • The PR title follows the Conventional Commit spec.

Open in Cursor Open in Web

This commit introduces the AsyncCogniteClient, a fully asynchronous version of the Cognite Python SDK. It leverages httpx for HTTP requests and provides a compatible synchronous wrapper (CogniteClient) for backward compatibility.

Co-authored-by: anders.hafreager <[email protected]>
Copy link

cursor bot commented Sep 8, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

cursoragent and others added 6 commits September 8, 2025 12:09
This commit introduces the async version of the Cognite SDK client, enabling asynchronous operations and improving performance for concurrent tasks. It includes the conversion of core infrastructure, API clients, and main client classes to support async/await patterns. Backward compatibility is maintained through a synchronous wrapper.

Co-authored-by: anders.hafreager <[email protected]>
This commit introduces asynchronous capabilities to the Cognite SDK, allowing for non-blocking I/O operations. The `AsyncCogniteClient` provides an async interface, while the existing `CogniteClient` remains backward compatible.

Co-authored-by: anders.hafreager <[email protected]>
@haakonvt
Copy link
Contributor

haakonvt commented Oct 3, 2025

Cursor is life, cursor is love

@haakonvt haakonvt closed this Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants