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
2 times, most recently
from
November 6, 2026 11:48
567f58e to
d0fb961
Compare
miladh
force-pushed
the
ai-ts-forecasting/03-low-level-api
branch
from
November 9, 2026 12:08
e1937b4 to
4e8d9dc
Compare
miladh
force-pushed
the
ai-ts-forecasting/04-dataframes
branch
2 times, most recently
from
November 9, 2026 12:58
0d5bc2d to
99e2230
Compare
DataFrame versions of forecast and impute, validated and converted like insert_dataframe: each numeric column is one time series, named by its label, so column names must be strings. cohort is one cohort for every column, or a mapping from column name to cohort. Datapoints keep the API's meaning. A NaN is a gap with no reading, sent as a datapoint without a value, so the model doesn't see it and impute doesn't return it. Both methods take missing, an optional boolean DataFrame sent as the API's missing flag: the datapoints to hide from the model whatever their value, which impute predicts. Like in the API, nothing is marked by default. The result is to_pandas of the result list: the median in one column per time series, with a timezone-naive DatetimeIndex in UTC like other SDK result DataFrames; a naive input index is taken to be in UTC, as in insert_dataframe. A DataFrame without a DatetimeIndex, with repeated, non-string or non-numeric columns (booleans included, as the API takes numbers only) or infinite values, a cohort mapping that names a column not in the DataFrame, or a missing that doesn't match 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>
…dataframe Like to_pandas, the DataFrame methods return the median only by default. include_all_quantiles returns every quantile level the API returns instead, as (column, quantile level) columns, and is passed on to to_pandas. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…aframe Forecasts a DataFrame with the median and with every quantile level, and imputes the gaps marked in missing: the result has one row per marked timestamp, and filling the gaps with it leaves no NaN. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
miladh
force-pushed
the
ai-ts-forecasting/03-low-level-api
branch
from
November 9, 2026 13:41
d55bb65 to
9e58935
Compare
miladh
force-pushed
the
ai-ts-forecasting/04-dataframes
branch
from
November 9, 2026 13:42
99e2230 to
1daa4fc
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, validated and converted likeinsert_dataframe:missing=is an optional boolean DataFrame with the same index and columns, sent as the API'smissingflag: the datapoints to hide from the model whatever their value, which impute predicts. Like in the API, nothing is marked by default.cohort=takes one cohort for every column, or a{column: cohort}mapping. Columns not in the mapping are processed independently.to_pandas()of the result list: the median in one column per time series, with a timezone-naive DatetimeIndex in UTC like other SDK result DataFrames.include_all_quantiles=Truegives(column, quantile level)columns for every level the API returns.missingthat doesn't match the DataFrame, is rejected before anything is sent.Usage
pandas is an optional extra, so the new tests are marked
dsl. Theai.time_seriesdocstring test moves to its owndsl-marked test, likedatapointsandraw.Checklist:
TestDataFramesintest_api/test_ai_time_series.py, and DataFrame integration tests intests_integration/test_api/test_ai_time_series.py.🤖 Generated with Claude Code