Skip to content

Commit b5a1f76

Browse files
committed
fix lint errors
1 parent f949fe1 commit b5a1f76

File tree

4 files changed

+14
-61
lines changed

4 files changed

+14
-61
lines changed

bigframes/bigquery/_operations/ai.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,7 @@ def forecast(
880880
id_cols: Iterable[str] | None = None,
881881
horizon: int = 10,
882882
confidence_level: float = 0.95,
883+
output_historical_time_series: bool = False,
883884
context_window: int | None = None,
884885
) -> dataframe.DataFrame:
885886
"""
@@ -914,6 +915,15 @@ def forecast(
914915
confidence_level (float, default 0.95):
915916
A FLOAT64 value that specifies the percentage of the future values that fall in the prediction interval.
916917
The default value is 0.95. The valid input range is [0, 1).
918+
output_historical_time_series (bool, default False):
919+
A BOOL value that determines whether the input data is returned
920+
along with the forecasted data. Set this argument to TRUE to return
921+
input data. The default value is FALSE.
922+
923+
Returning the input data along with the forecasted data lets you
924+
compare the historical value of the data column with the forecasted
925+
value of the data column, or chart the change in the data column
926+
values over time.
917927
context_window (int, optional):
918928
An int value that specifies the context window length used by BigQuery ML's built-in TimesFM model.
919929
The context window length determines how many of the most recent data points from the input time series are use by the model.
@@ -945,6 +955,7 @@ def forecast(
945955
"timestamp_col": timestamp_col,
946956
"model": model,
947957
"horizon": horizon,
958+
"output_historical_time_series": output_historical_time_series,
948959
"confidence_level": confidence_level,
949960
}
950961
if id_cols:

patch_tests.diff

Lines changed: 0 additions & 21 deletions
This file was deleted.

tests/system/small/extensions/test_dataframe_accessor.py

Lines changed: 0 additions & 39 deletions
This file was deleted.

tests/unit/core/compile/sqlglot/test_dataframe_accessor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ def to_pandas(series, *, ordered):
4646

4747

4848
def test_ai_forecast(snapshot, monkeypatch):
49-
import bigframes.session
5049
import bigframes.bigquery.ai
50+
import bigframes.session
51+
5152
session = mock.create_autospec(bigframes.session.Session)
5253
bf_df = mock.create_autospec(bpd.DataFrame)
5354
session.read_pandas.return_value = bf_df
@@ -59,6 +60,7 @@ def mock_ai_forecast(df, **kwargs):
5960
return result_df
6061

6162
import bigframes.bigquery.ai
63+
6264
monkeypatch.setattr(bigframes.bigquery.ai, "forecast", mock_ai_forecast)
6365

6466
df = pd.DataFrame({"date": ["2020-01-01"], "value": [1.0]})

0 commit comments

Comments
 (0)