Fix review comments: backtest-only fold coverage, null_converter safety, CHRONOS_MAX_RETRIES clarity, retry tests#247
Merged
Conversation
…, backtest-only fold coverage, retry tests Agent-Logs-Url: https://github.com/microsoft/finnts/sessions/fbb0b01c-29a0-4759-a221-760420544afa Co-authored-by: smdp2000ofc <236835326+smdp2000ofc@users.noreply.github.com>
…lumns Agent-Logs-Url: https://github.com/microsoft/finnts/sessions/fbb0b01c-29a0-4759-a221-760420544afa Co-authored-by: smdp2000ofc <236835326+smdp2000ofc@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix null backtest fold and best model selection
Fix review comments: backtest-only fold coverage, null_converter safety, CHRONOS_MAX_RETRIES clarity, retry tests
Apr 30, 2026
smdp2000ofc
approved these changes
Apr 30, 2026
smdp2000ofc
approved these changes
Apr 30, 2026
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.
Addresses four reviewer concerns from the previous PR: a type-safety bug in
null_converter, ambiguous retry documentation, fold coverage logic incorrectly including future forecast IDs, and missing unit tests for the retry path.null_converter()— type-safe NULL string checkx == "NULL"coerces non-character scalars and can propagateNAinto anifcondition. Changed toidentical(x, "NULL"):CHRONOS_MAX_RETRIES— clarify retry vs attempt semanticsCHRONOS_MAX_RETRIES = 3means 3 retries, 4 total attempts. Updated the constant comment andsend_chronos_requestdocstring to state this explicitly. Loop behavior is unchanged.final_models.R— exclude future forecast ID from fold coveragetrain_test_id_listincludesTrain_Test_ID == 1(future forecast). Using it as the denominator for back test fold coverage unfairly excluded models that produced back tests but not future output. Changed to:Also vectorized the per-model warning (list-columns via
summarise/mutate) to avoid O(N×M) repeated filtering, addedexpected_back_test_fold_count == 0edge-case handling, and ensured the emptypartial_models_tblcarries all expected columns.New tests
send_chronos_request: 5 tests with mockedhttr::POSTand a no-opbackoff_wait— connection error exhaustion (exactly 4 attempts), 429→success, 500→success, non-retryable 4xx (1 attempt), and total-attempt boundary (CHRONOS_MAX_RETRIES + 1).null_converter: 7 tests covering NULL, zero-length,"NULL"string, NA variants, normal values, multi-element vectors, and non-character scalars.