unit8co/darts

Improve error message when future covariates are missing during backtest() call

Open

#2,846 opened on Jul 18, 2025

View on GitHub
 (5 comments) (0 reactions) (0 assignees)Python (762 forks)batch import
good first issueimprovement

Repository metrics

Stars
 (6,832 stars)
PR merge metrics
 (Avg merge 143d 16h) (16 merged PRs in 30d)

Description

Is your feature request related to a current problem? Please describe. Yes.When using backtest() with a model trained with train and val future covariates, forgetting to pass the full future covariates again at backtest time results in an error (IndexError: index 1 is out of bounds for axis 0 with size 1.).

Describe proposed solution A better explanation or error message should be thrown as it is the case for "regular" historical forecasts.

Additional context Error currently thrown :

IndexError: index 1 is out of bounds for axis 0 with size 1.

Contributor guide