Skip to content

feat(time series): Add time_series_type helper param to data_modeling.time_series.list (DM-4186) - #2870

Open
haakonvt wants to merge 9 commits into
masterfrom
improve-state-ts-list
Open

haakonvt wants to merge 9 commits into
masterfrom
improve-state-ts-list

Conversation

@haakonvt

@haakonvt haakonvt commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

The classic time series API (client.time_series.list / client.time_series(...)) never returns state time series: the API leaves them out unless includeAllTypes=true is passed (beta), which the SDK does not support. This holds even when filtering on type="state" (tested + confirmed with the Time Series team on Slack). This PR makes that discoverable and gives users an easy way to list state time series instead.

  • New time_series_type parameter on client.data_modeling.time_series.list.
  • Docs: added a note to the classic TimeSeriesAPI.list and __call__ explaining that state time series are never returned, with a Sphinx link to client.data_modeling.time_series.list(is_state=True).

@haakonvt
haakonvt requested review from a team as code owners October 2, 2026 12:30

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for filtering state time series in the Data Modeling Time Series API by introducing an is_state parameter to the list methods. It also updates the classic Time Series API documentation to clarify that state time series are only accessible via the Data Modeling API. The review feedback suggests improving type safety in the new unit tests by replacing bare dict type hints with explicit dict[str, Any] annotations, in accordance with the repository's Strong Typing style guide.

Comment thread tests/tests_unit/test_api/test_data_modeling/test_time_series.py
Comment thread tests/tests_unit/test_api/test_data_modeling/test_time_series.py Outdated
@haakonvt haakonvt changed the title feat(time series): Add is_state helper param to data_modeling.time_series.list feat(time series): Add is_state helper param to data_modeling.time_series.list Oct 2, 2026
@codecov

codecov Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.48%. Comparing base (1ab3df0) to head (4ec523c).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2870      +/-   ##
==========================================
- Coverage   93.49%   93.48%   -0.01%     
==========================================
  Files         527      528       +1     
  Lines       55489    55555      +66     
==========================================
+ Hits        51879    51938      +59     
- Misses       3610     3617       +7     
Files with missing lines Coverage Δ
cognite/client/_api/data_modeling/time_series.py 97.82% <100.00%> (+0.60%) ⬆️
cognite/client/_api/time_series.py 100.00% <ø> (ø)
...nite/client/_sync_api/data_modeling/time_series.py 100.00% <ø> (ø)
cognite/client/_sync_api/time_series.py 100.00% <ø> (ø)
...ests/tests_integration/test_api/test_datapoints.py 99.44% <100.00%> (+<0.01%) ⬆️
...it/test_api/test_data_modeling/test_time_series.py 100.00% <100.00%> (ø)

... and 5 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 changed the title feat(time series): Add is_state helper param to data_modeling.time_series.list feat(time series): Add is_state helper param to data_modeling.time_series.list (DM-4186) Oct 2, 2026
@haakonvt
haakonvt force-pushed the improve-state-ts-list branch from df2887f to 4ec523c Compare October 2, 2026 12:42
sighol
sighol previously requested changes Oct 2, 2026
Comment thread cognite/client/_api/data_modeling/time_series.py Outdated
@haakonvt
haakonvt force-pushed the improve-state-ts-list branch from 168b210 to 8062bdc Compare October 2, 2026 15:25
@haakonvt
haakonvt enabled auto-merge October 2, 2026 15:25
@haakonvt haakonvt self-assigned this Oct 2, 2026
@haakonvt haakonvt added risk-review-ongoing Risk review is in progress waiting-for-team Waiting for the submitter or reviewer of the PR to take an action labels Oct 2, 2026
@haakonvt

haakonvt commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

🦄

@haakonvt

haakonvt commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Currently blocked by pg3 bug: https://github.com/cognitedata/pgpgpg/pull/2227

@haakonvt haakonvt changed the title feat(time series): Add is_state helper param to data_modeling.time_series.list (DM-4186) feat(time series): Add time_series_type helper param to data_modeling.time_series.list (DM-4186) Oct 2, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk-review-ongoing Risk review is in progress waiting-for-team Waiting for the submitter or reviewer of the PR to take an action

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants