Skip to content

fix: reject an empty horizon with a 400 instead of failing in the model - #187

Merged
andig merged 1 commit into
mainfrom
fix/empty-horizon
Oct 4, 2026
Merged

andig merged 1 commit into
mainfrom
fix/empty-horizon

Conversation

@andig

@andig andig commented Oct 4, 2026

Copy link
Copy Markdown
Member

Noticed while reviewing #184.

A request whose time series are all empty passes the length check, since every length is equal, and reaches the model, which fails on the first np.min over no prices and comes back as a 500 with zero-size array to reduction operation minimum which has no identity. There is nothing to optimize over an empty horizon, so it is a bad request.

  • Empty time series are rejected with a 400 and a message naming the cause, next to the length check.

🤖 Generated with Claude Code

@andig andig added the bug Something isn't working label Oct 4, 2026
@andig
andig merged commit 8d78fc2 into main Oct 4, 2026
1 check passed
@andig
andig deleted the fix/empty-horizon branch October 4, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant