Repository navigation
Conversation
3 tasks done
miladh
force-pushed
the
ai-ts-forecasting/04-dataframes
branch
from
November 2, 2026 11:15
bc78e48 to
8e32224
Compare
miladh
force-pushed
the
ai-ts-forecasting/03-low-level-api
branch
from
November 2, 2026 11:15
9d62a18 to
1bb7339
Compare
miladh
marked this pull request as ready for review
November 2, 2026 11:23
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces forecast_dataframe and impute_dataframe methods to both the async and sync AI Time Series APIs, allowing users to forecast and reconstruct missing values directly from pandas DataFrames. Feedback on the implementation of the _dataframe_to_input helper function highlights the need for improved robustness, specifically regarding DatetimeIndex validation, timezone-aware index handling, and validating that all columns are numeric to prevent cryptic runtime errors.
miladh
force-pushed
the
ai-ts-forecasting/03-low-level-api
branch
from
November 4, 2026 21:41
1bb7339 to
0fd9b72
Compare
miladh
force-pushed
the
ai-ts-forecasting/04-dataframes
branch
from
November 4, 2026 21:50
8802d44 to
bf68252
Compare
miladh
force-pushed
the
ai-ts-forecasting/03-low-level-api
branch
from
November 5, 2026 09:23
0fd9b72 to
c20d0a9
Compare
miladh
force-pushed
the
ai-ts-forecasting/04-dataframes
branch
from
November 5, 2026 09:23
bf68252 to
9118e3c
Compare
miladh
force-pushed
the
ai-ts-forecasting/03-low-level-api
branch
from
November 6, 2026 11:40
c20d0a9 to
71a6259
Compare
miladh
force-pushed
the
ai-ts-forecasting/04-dataframes
branch
from
November 6, 2026 11:40
9118e3c to
567f58e
Compare
DataFrame versions of forecast and impute: each numeric column is one time series, labelled by its column name, and NaN values are marked missing, so impute predicts them. cohort is one cohort for every column, or a mapping from column name to cohort. The result has a (column, quantile level) column for every column, with the median as the only level, like to_pandas, and the input's column names and timezone; a naive index is taken to be in UTC, as in insert_dataframe. A DataFrame without a DatetimeIndex, with repeated or non-numeric columns or infinite values, or a cohort mapping that names a column not in the DataFrame, is rejected before anything is sent. The docstrings note that the endpoints are in beta. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Like to_pandas, they return the median only by default. quantile_levels selects other levels: a list of levels, or None for every level the API returns. It is passed on to to_pandas. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…aframe Forecasts a DataFrame with the median and with every quantile level, and imputes its NaN values: the result has one row per NaN timestamp, and filling the gaps with the median leaves no NaN. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
miladh
force-pushed
the
ai-ts-forecasting/04-dataframes
branch
from
November 6, 2026 11:48
567f58e to
d0fb961
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #2875.
Description
DataFrame variants of
forecastandimpute, following theinsert_dataframe/retrieve_dataframeconvention:impute_dataframe, predicted.cohort=takes one cohort for every column, or a{column: cohort}mapping. Columns not in the mapping are processed independently.quantile_levelsselects the quantile levels in the result: the median (0.5) by default, a list of levels, orNonefor every level the API returns.(column, quantile level)column for every column and included quantile level. It keeps the input's column names and timezone; a naive index is taken to be in UTC, as ininsert_dataframe.Usage
pandas is an optional extra, so the new tests are marked
dsl. The docstrings note that the endpoints are in beta. Theai.time_seriesdocstring test moves to its owndsl-marked test, likedatapointsandraw.Checklist:
TestDataFramesintest_api/test_ai_time_series.py.🤖 Generated with Claude Code