Skip to content

[BUG] predict: forwards y to non-annotators, drops time index in interval/var modes, unbounded horizon #536

Description

@Shashankss1205

Severity: P2 — output quality / consistency. Verified live 2026-08-09.

Three predict issues, all confirmed over the wire.

NB-18 — predict forwards y blindly to non-annotator estimators

predict(estimator_handle=<forecaster>, y_dataset="arrow_head")
  -> {"error": "BaseForecaster.predict() got an unexpected keyword argument 'y'"}

The y_dataset/y_handle args exist for annotators, but they're passed through to any estimator, producing a raw sktime TypeError for forecasters.
Fix: scitype-aware handling — only forward y to estimators whose predict accepts it; otherwise a clear message ("forecasters do not accept y at predict").

NB-21 — interval/variance modes drop the time index

predict keys by period:

{"1961-01": 417.0, "1961-02": 391.0, ...}

but predict_interval / predict_var return bare arrays with no labels:

"intervals": {"sales_0.8_lower": [215.34, 199.33, ...], "sales_0.8_upper": [...]}

The caller can't map interval/variance values back to time points.
Fix: index-key all modes consistently.

NB-22 — predict payload is unbounded

predict(estimator_handle=<fitted>, horizon=1000) returns 1000 inline period-keyed rows (~30 KB+ JSON), no cap or truncation. Any large horizon floods the client context.
Fix: soft cap / truncated preview with a row count, consistent with the response-limit machinery used elsewhere (and the job-result cap added in commit 2b9aa16).

(Catalogued as NB-18 / NB-21 / NB-22 in MCP_TEST_FINDINGS.md.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions