Skip to content

Raise clear error when gridsearch() receives multiple TimeSeries - #3191

Merged
dennisbader merged 5 commits into
unit8co:masterfrom
COMPUMAX-EC:fix/gridsearch-multiple-series-error-message
Sep 18, 2026
Merged

dennisbader merged 5 commits into
unit8co:masterfrom
COMPUMAX-EC:fix/gridsearch-multiple-series-error-message

Conversation

@COMPUMAX-EC

Copy link
Copy Markdown
Contributor

Fixes #1622

gridsearch() only supports a single TimeSeries for series, val_series, past_covariates, and future_covariates. Passing a sequence of TimeSeries previously failed deep in the call stack with a cryptic error (e.g. "The two TimeSeries sequences must have the same length"), instead of a clear message at the point of the mistake.

This adds an early validation check using the existing get_series_seq_type helper, raising a ValueError that names the offending argument, plus a parametrized test covering all four arguments.

`gridsearch()` only supports a single TimeSeries for `series`,
`val_series`, `past_covariates`, and `future_covariates`. Passing a
sequence of TimeSeries previously failed deep in the call stack with
a cryptic error (e.g. "The two TimeSeries sequences must have the
same length"), making the actual problem hard to diagnose.

Fixes unit8co#1622

@dennisbader dennisbader left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks a lot for this PR and your first contribution @COMPUMAX-EC 🚀

Everything looks good. I applied some minor changes to make it ready for merging.

I'll merge once all tests have passed.

@codecov

codecov Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.06%. Comparing base (4ce4d4b) to head (9d0a53b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3191   +/-   ##
=======================================
  Coverage   97.06%   97.06%           
=======================================
  Files         169      169           
  Lines       18898    18901    +3     
=======================================
+ Hits        18343    18346    +3     
  Misses        555      555           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dennisbader
dennisbader merged commit 5817636 into unit8co:master Sep 18, 2026
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.

Gridsearch doesn't work with multiple timeseries

2 participants