Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## ai-ts-forecasting/01-data-classes #2874 +/- ##
====================================================================
Coverage ? 93.52%
====================================================================
Files ? 530
Lines ? 55704
Branches ? 0
====================================================================
Hits ? 52097
Misses ? 3607
Partials ? 0
🚀 New features to boost your workflow:
|
33d7eca to
cfaa6d5
Compare
ea1105b to
12e6a69
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces a utility function split_into_requests to batch InputTimeSeries into requests of at most 256 without splitting cohorts, along with corresponding unit tests. The review feedback points out two issues: handling of empty input (which currently returns [[]] instead of []) and potential key collisions when grouping series without a cohort using integer indices. Actionable suggestions are provided to use object() as a fallback key to avoid collisions and to add a unit test verifying empty input behavior.
b5fb7d7 to
70ed67e
Compare
The forecast and impute endpoints accept at most 32 series and 5 MiB per request, counted as sent (after gzip, unless it is disabled), and a cohort must reach the model in one request. split_into_requests packs series into requests within both limits without splitting a cohort, using a size function from the caller, and raises before anything is sent if a cohort or series is over a limit on its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Packing grouped a cohort's series together, so a request could list them in a different order than the input. The API locates errors by position in the request (items[i]), so those locations pointed at the wrong series. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
70ed67e to
c601549
Compare
Stacked on #2873
Description
The forecast and impute endpoints accept at most 32 series and 5 MiB per request, counted as sent (after gzip, unless it's disabled), and a cohort must reach the model in one request.
split_into_requests(inutils/_forecasting.py) packs series into requests within both limits, without splitting a cohort, and keeps their input order within each request, so the API's error locations (items[i]) match the input. The caller passes a function that measures a request body as sent; #2875 measures it with the SDK's own request serialization. A cohort with more than 32 series, or a cohort or series over 5 MiB on its own, raisesValueErrorbefore anything is sent.This is internal and not user-facing yet; #2875 uses it.
Checklist:
test_utils/test_forecasting.py, including seeded randomized checks of both limits and of cohorts staying together.🤖 Generated with Claude Code