Skip to content

fix: validate quantile_by_key in arx_forecaster() and flatline_forecaster() (#229)#481

Open
gregfaletto wants to merge 2 commits into
cmu-delphi:devfrom
gregfaletto:fix-flatline-quantile-by-key-229
Open

fix: validate quantile_by_key in arx_forecaster() and flatline_forecaster() (#229)#481
gregfaletto wants to merge 2 commits into
cmu-delphi:devfrom
gregfaletto:fix-flatline-quantile-by-key-229

Conversation

@gregfaletto
Copy link
Copy Markdown
Contributor

Resolves #229. arx_forecaster() and flatline_forecaster() now error at the forecaster boundary when quantile_by_key contains columns that are not in key_colnames(epi_data), instead of silently dropping them downstream — flatline_forecaster()'s suppressWarnings(forecast(wf)) wrapper made the layer's warning invisible. Also adds a warning when arx_forecaster() is called with a quantile-output trainer (quantile_reg() or rand_forest(engine = "grf_quantiles")) plus a non-empty quantile_by_key — the argument is silently dropped in that branch.

The 2023 headline failure (flatline crashing on quantile_by_key = "geo_value") no longer reproduces — residuals.flatline carries the key through, and the call now works cleanly. cdc_baseline_forecaster uses a different layer (layer_cdc_flatline_quantiles) with the same parallel-structure vulnerability; deferred to a follow-up issue.

Version bumped 0.2.5 → 0.2.6. All checks clean (devtools::test() 916/0/2; devtools::check() 0 errors with the same WARNING/NOTE baseline as recent merged PRs).

gregfaletto and others added 2 commits May 19, 2026 22:44
…er (cmu-delphi#229)

arx_forecaster() and flatline_forecaster() now error at the forecaster
boundary when quantile_by_key contains columns that are not in
key_colnames(epi_data), instead of silently dropping them downstream.
For flatline_forecaster() in particular the layer-level warning was
invisible because forecast(wf) is wrapped in suppressWarnings(), so
users got no signal at all on invalid input.

Also adds a warning when arx_forecaster() is called with a quantile-
output trainer (quantile_reg() or rand_forest with engine
"grf_quantiles") plus a non-empty quantile_by_key. The argument is
silently dropped in that code branch; the warning surfaces the
no-op without breaking working code.

The 2023 headline failure (flatline crashing on a valid key) no longer
reproduces - residuals.flatline carries geo_value through and the
call works cleanly. cdc_baseline_forecaster uses a different layer
with the same parallel-structure vulnerability; deferred to a
follow-up issue.

Version bumped 0.2.5 -> 0.2.7 (skipping 0.2.6 for the open PR cmu-delphi#480
collision).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Switches the version bump for cmu-delphi#229 from 0.2.7 to 0.2.6 so the
maintainer can choose the merge order against the still-open PR cmu-delphi#480
(doc regen, also targeting 0.2.6). Whichever PR merges first claims
0.2.6; the other rebases to 0.2.7 at merge time.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gregfaletto gregfaletto requested a review from dajmcdon as a code owner May 20, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected error with flatline_forecaster() w/ quantile_by_key; unexpected "successes" w/ invalid cols

1 participant