feat(records): Records API #2616
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements all 6 endpoints (ingest, upsert, delete, list, sync, aggregate) for cognite.client.data_modeling.records with full typed DTOs, async generator for sync(), chunked writes, and the complete 16-step wiring (testing mocks, docs, doctest registration, retry classification, sync codegen). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Any commit after this message are follow ups to correct claude code first iteration. |
Sphinx autosummary requires the class to be importable via BUILD_COGNITE_SDK_DOCS block so it can resolve AsyncCogniteClient.data_modeling.records in the RST directives. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2616 +/- ##
==========================================
+ Coverage 93.03% 93.05% +0.02%
==========================================
Files 486 490 +4
Lines 49208 49996 +788
==========================================
+ Hits 45780 46526 +746
- Misses 3428 3470 +42
🚀 New features to boost your workflow:
|
- Replace en-dash (–) with hyphen (-) in 4 docstrings (RUF002) - Remove unused type: ignore [misc] comment in sync records API (mypy) - Fix docstring quote style from double to single in Literal types (custom-checks) - Add RecordsAPI to _make_accessors_for_building_docs() so Sphinx can discover data_modeling.records Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request implements the Records API within the Data Modeling module, introducing new DTOs for records and aggregates, the RecordsAPI client (both async and sync), and comprehensive unit tests. The review feedback identifies several critical issues: a bug in the sync method where request parameters are lost during pagination, missing cognite_client references in resource loaders which breaks SDK consistency, and potential KeyError exceptions when processing deleted record tombstones. Additionally, it is recommended to inherit from CogniteObject for helper DTOs to align with the implementation plan and SDK architecture.
ruff requires imports sorted alphabetically; records must come before space_statistics. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@gemini-code-assist why are you commenting about |
|
Apologies for the confusion. You are correct that |
@gemini-code-assist do we have outdated instructions about this? |
|
Apologies for the confusion in our previous interaction. Regarding your question, we do not have outdated instructions in the codebase or the provided context. The mention of |
|
Just mentioning this (likely close candidate) #2535 |
Implements all 6 endpoints (ingest, upsert, delete, list, sync,
aggregate) for cognite.client.data_modeling.records with full
typed DTOs, async generator for sync(), chunked writes, and the
complete 16-step wiring (testing mocks, docs, doctest registration,
retry classification, sync codegen).