feat(records): sync endpoint#2698
Open
andersfylling wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request implements record synchronization capabilities for data modeling, adding sync and sync_resume endpoints to both the sync and async clients, along with supporting data classes like SyncRecord and SyncRecordList. Feedback focuses on improving safety and readability, specifically by using .get() to avoid potential KeyErrors when parsing API responses in SyncRecordList and renaming a loop variable in SyncRecord to prevent parameter shadowing.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2698 +/- ##
========================================
Coverage 93.67% 93.68%
========================================
Files 503 503
Lines 50696 50877 +181
========================================
+ Hits 47488 47662 +174
- Misses 3208 3215 +7
🚀 New features to boost your workflow:
|
c9b8f95 to
4121c8b
Compare
Co-authored-by: Cursor <cursoragent@cursor.com>
Separate initial sync from cursor-based continuation while sharing the request assembly and pagination through the internal _sync helper. Co-authored-by: Cursor <cursoragent@cursor.com>
Deep-copy record property payloads when dumping so load/dump round-trip tests and callers cannot mutate the source instance through the returned dictionary. Co-authored-by: Cursor <cursoragent@cursor.com>
4121c8b to
7233a6a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See https://docs.cognite.com/20230101/records/sync-records-from-a-stream
Since we don't have hierarchical rate limiting I've chosen a number that doesn't cause issue for any configuration: https://docs.cognite.com/api-reference/concepts/20230101/rate-limits#records-request-budgets-detailed-tables