Skip to content

Conversation

@MortGron
Copy link
Contributor

@MortGron MortGron commented Jun 16, 2025

v8 overview: https://cognitedata.atlassian.net/browse/DM-3055

Description

Ingesting no datapoints will no longer raise an error. When ingesting datapoints into multiple time series, if one of them contains no datapoints, that will be removed from the request.

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.
  • Changelog updated in CHANGELOG.md.
  • Version bumped. If triggering a new release is desired, bump the version number in _version.py and pyproject.toml per semantic versioning.

@MortGron MortGron requested a review from erlendvollset June 16, 2025 10:39
@codecov
Copy link

codecov bot commented Jun 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.65%. Comparing base (9cd62cb) to head (ada8eae).
⚠️ Report is 118 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2172   +/-   ##
=======================================
  Coverage   90.64%   90.65%           
=======================================
  Files         159      159           
  Lines       24118    24120    +2     
=======================================
+ Hits        21862    21866    +4     
+ Misses       2256     2254    -2     
Files with missing lines Coverage Δ
cognite/client/_api/datapoints.py 98.77% <100.00%> (+0.14%) ⬆️

... and 1 file 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.

@MortGron MortGron marked this pull request as ready for review June 16, 2025 10:45
@MortGron MortGron requested review from a team as code owners June 16, 2025 10:45
@MortGron
Copy link
Contributor Author

Should this be part of V8 release? It changes tested behaviour, so I assume it would? @erlendvollset

Copy link
Collaborator

@erlendvollset erlendvollset left a comment

Choose a reason for hiding this comment

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

LGTM. Bump version and update changelog, and it should be good to go!

@erlendvollset
Copy link
Collaborator

Should this be part of V8 release? It changes tested behaviour, so I assume it would? @erlendvollset

Changes behaviour yes, but not in a breaking way, so a minor version bump is sufficient.

@erlendvollset
Copy link
Collaborator

It is in fact breaking, I did not consider this (thanks @larshagencognite):

def is_empty(my_list: list[object]):
  try:
    cognite_client.timeseries.datapoints.ingest([{timestamp:..., value:...} for obj in my_list])
    return False
  except Exception:
    return True

@MortGron MortGron changed the title Ingesting no datapoints no longer raises an exception [V8] Ingesting no datapoints no longer raises an exception Jun 16, 2025
@haakonvt
Copy link
Contributor

haakonvt commented Oct 7, 2025

Merged manually into #2273

@haakonvt haakonvt closed this Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants