feat(integrations): Add Integrations API data classes - #2819
Open
vikramlc-cognite wants to merge 1 commit into
Open
feat(integrations): Add Integrations API data classes#2819vikramlc-cognite wants to merge 1 commit into
vikramlc-cognite wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2819 +/- ##
==========================================
- Coverage 93.15% 93.14% -0.01%
==========================================
Files 516 523 +7
Lines 53665 54012 +347
==========================================
+ Hits 49993 50311 +318
- Misses 3672 3701 +29
🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces data classes and unit tests for the integrations feature, including actions, configurations, errors, integrations, and tasks. The feedback highlights multiple violations of the style guide where redundant load/dump round-trip tests were written for subclasses of CogniteResource and CogniteUpdate. These tests should be removed or replaced with specific tests such as as_write, as load/dump functionality is already tested automatically.
Adds the data classes for the new Integrations API (Integration, Task, Extractor, Action, ConfigRevision, IntegrationError, TaskHistory, SyncResult) with load/dump round-trip tests. No API client or SDK wiring yet — that follows in a subsequent PR. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
vikramlc-cognite
force-pushed
the
integrations-part1-data-classes
branch
from
September 7, 2026 12:50
b248f28 to
efafae0
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.
Summary
Adds the data classes for the new Integrations API (Integration, Task, Extractor, Action, ConfigRevision, IntegrationError, TaskHistory, SyncResult) with load/dump round-trip tests. No API client or SDK wiring yet - the classes are not reachable from
CogniteClientuntil the follow-up PR lands.Type of change
What changed
cognite/client/data_classes/integrations/withintegrations.py,actions.py,config.py,errors.py,tasks.py, and an__init__.pythat re-exports everything with an explicit__all__(not re-exported from the top-leveldata_classes/__init__.py, matching thesimulatorsalpha-module precedent).Integration/IntegrationWrite/IntegrationList/IntegrationUpdate(external-id-keyed, standard set/set_null/metadata add-remove update pattern),Extractor,Task.Action/ActionWrite/ActionListfor the remote-command sub-resource.ConfigRevision/ConfigRevisionWrite/ConfigRevisionMetadatafor versioned config.IntegrationError/IntegrationErrorListandTaskHistory/TaskHistoryList/SyncResultfor error reporting and task history.ExternalIDTransformerMixin- this API has no internal numericid, everything is keyed by external ID only.tests/tests_unit/test_data_classes/test_integrations.pycovering load/dump round-trips for every class, including explicit-nullhandling fortasks/history/errors.Why it changed
What to focus on during review
ActiveConfigRevision: TypeAlias = int | Literal["local"]inintegrations.py- shared bytasks.py/errors.pyand bycheckin.pyin the PR that follows this one.Integration.__init__guaranteesself.tasks = tasks or [](neverNone), and_load/dumpexplicitly handle the server sending JSONnullfortasks(not just an absent key) - seetest_load_with_explicit_null_tasks.Test evidence
pytest tests/tests_unit/test_data_classes/test_integrations.py -q→ 13 passedruff check/ruff format --check→ cleanmypy(viapoetry run dmypy run -- cognite tests) → no issuesRisks and unknowns
Rollout and rollback
Checklist