Repository navigation
BOT: Fix #839: Remove test_columns_not_present() wrapper - #1083
Conversation
Replace the single call site in assert_forecast.forecast_binary() with an inline checkmate::test_names() call, delete the function definition, its tests, and man page. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1083 +/- ##
==========================================
- Coverage 97.94% 97.94% -0.01%
==========================================
Files 37 37
Lines 1951 1950 -1
==========================================
- Hits 1911 1910 -1
Misses 40 40 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
nikosbosse
left a comment
There was a problem hiding this comment.
CLAUDE: Clean, minimal removal of a trivial wrapper function. The inline replacement of test_columns_not_present() with test_names(colnames(forecast), disjunct.from = ...) is semantically identical — verified by reading the original function body. All 4 test specifications are covered (sample_id rejection, quantile_level rejection, valid data acceptance, function removal verification). No issues found. NAMESPACE correctly updated. Verdict: approve.
Summary
test_columns_not_present()wrapper function that simply delegated tocheckmate::test_names(..., disjunct.from = ...)assert_forecast.forecast_binary()with an inlinetest_names()callCloses #839
Root cause
test_columns_not_present()was a 1-line wrapper around an already-importedcheckmatefunction, adding unnecessary indirection.What changed
R/class-forecast-binary.R: Replacedtest_columns_not_present(forecast, ...)withtest_names(colnames(forecast), disjunct.from = ...)R/check-input-helpers.R: Deleted function definition and roxygen blocktests/testthat/test-check-input-helpers.R: Deleted thetest_columns_not_presenttest blockman/test_columns_not_present.Rd: Deleted generated man pagetests/testthat/test-class-forecast-binary.R: Added tests forquantile_levelcolumn rejection, valid data acceptance, and function removal verificationTest plan
quantile_levelcolumn correctly rejected byassert_forecast.forecast_binary()test_columns_not_presentno longer exists in the namespacesample_idcolumn rejection test continues to pass🤖 Generated with Claude Code