Skip to content

Conversation

@haakonvt
Copy link
Contributor

@haakonvt haakonvt commented Jan 8, 2026

https://cognitedata.atlassian.net/browse/DM-3373

New changes

Should be reviewed commit-by-commit:

  • change default DM search operator to AND
  • remove alpha warning from extractor_extensions/v1.py
  • remove is_uploaded and uploaded_time from file apply in extractor_extensions/v1.py
  • clean up system-managed read-only fields from cdm/v1.py
  • remove CogniteResponse and CogniteObject. remove client reference from CogniteResource
  • refactor: update APIClient to use _maybe_set_client_ref pattern
  • refactor: remove passing client ref in all API modules
  • refactor: remove client parameter from data classes + load methods
  • remove unused type hints. update utils and supporting modules
  • test: update tests after client ref removal
  • docs: update documentation and scripts after client ref removal
  • support allow_expired_cursors_and_accept_missed_deletes in instances/sync
  • add load-if-method to handle loading optional attributes

@haakonvt haakonvt requested review from a team as code owners January 8, 2026 11:17
@gemini-code-assist
Copy link
Contributor

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

@haakonvt haakonvt force-pushed the httpx-switch-release-alpha4 branch from 8c9eba6 to e17688b Compare January 9, 2026 06:56
@codecov
Copy link

codecov bot commented Jan 9, 2026

Codecov Report

❌ Patch coverage is 45.79618% with 851 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.58%. Comparing base (b0eedac) to head (f0bb599).
⚠️ Report is 1 commits behind head on pysdk-release-v8.

Files with missing lines Patch % Lines
cognite/client/data_classes/_base.py 43.10% 66 Missing ⚠️
cognite/client/data_classes/contextualization.py 20.00% 36 Missing ⚠️
cognite/client/data_classes/simulators/models.py 33.33% 34 Missing ⚠️
...ite/client/data_classes/data_modeling/instances.py 27.50% 29 Missing ⚠️
...lient/data_classes/simulators/routine_revisions.py 17.14% 29 Missing ⚠️
cognite/client/data_classes/workflows.py 3.33% 29 Missing ⚠️
cognite/client/data_classes/agents/chat.py 21.87% 25 Missing ⚠️
...te/client/data_classes/data_modeling/containers.py 22.58% 24 Missing ⚠️
cognite/client/data_classes/data_modeling/query.py 38.46% 24 Missing ⚠️
...gnite/client/data_classes/simulators/simulators.py 25.80% 23 Missing ⚠️
... and 67 more
Additional details and impacted files
@@                 Coverage Diff                  @@
##           pysdk-release-v8    #2440      +/-   ##
====================================================
- Coverage             64.80%   64.58%   -0.23%     
====================================================
  Files                   467      467              
  Lines                 47418    47484      +66     
====================================================
- Hits                  30731    30669      -62     
- Misses                16687    16815     +128     
Files with missing lines Coverage Δ
cognite/client/_api/agents/agents.py 50.00% <100.00%> (ø)
cognite/client/_api/annotations.py 50.00% <100.00%> (ø)
cognite/client/_api/assets.py 66.11% <100.00%> (ø)
...nite/client/_api/data_modeling/space_statistics.py 25.00% <100.00%> (ø)
cognite/client/_api/data_modeling/statistics.py 30.76% <100.00%> (ø)
cognite/client/_api/data_modeling/views.py 43.47% <100.00%> (ø)
cognite/client/_api/datapoints.py 73.01% <100.00%> (ø)
cognite/client/_api/diagrams.py 55.05% <100.00%> (ø)
cognite/client/_api/documents.py 53.84% <100.00%> (ø)
cognite/client/_api/extractionpipelines/configs.py 42.85% <100.00%> (ø)
... and 147 more

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@haakonvt haakonvt force-pushed the httpx-switch-release-alpha4 branch 4 times, most recently from ae07d8b to abf38e6 Compare January 16, 2026 12:41
@haakonvt haakonvt force-pushed the httpx-switch-release-alpha4 branch 2 times, most recently from d6a889b to 2a622fc Compare January 16, 2026 22:43
@haakonvt haakonvt force-pushed the httpx-switch-release-alpha4 branch from 2a622fc to c9e780f Compare January 16, 2026 22:50
@haakonvt haakonvt force-pushed the httpx-switch-release-alpha4 branch from c9e780f to f0bb599 Compare January 16, 2026 23:01
Copy link
Contributor

@doctrino doctrino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff, on request for further v8 improvement.

self._cognite_client = cast("AsyncCogniteClient", cognite_client)
super().__init__(resources)
self._build_id_mappings()
self._build_id_mappings() # TODO: Make lazy?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to drop this for v8. It does not make sense to me that a list object build up a custom mapping to behave like a dict.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, you for sure have a point. I believe, unfortunately, that this is one of the more used helper utilities we have and so removing it might annoy a bit too many users. I do think we should make it lazy init though.

instance = resource_cls(*positional_arguments, **keyword_arguments)

# Set client reference on resources that use it:
if hasattr(instance, "set_client_ref"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this use the _maybe_set_client method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the FakeCogniteResourceGenerator can create all kinds of objects, from filters to aggregations to sequences of strings, I assumed most objects were not going to be CogniteResource subclasses, that I went with this hasattr check instead.

@doctrino doctrino self-requested a review January 19, 2026 13:09
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