Repository navigation
Preserve data-frame reporting when one supported column remains - #620
Conversation
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open issues
1 file not reviewed
man/report.Rd: Generated file
What changed in this PR
Fixes a regression where filtering list-columns from data frames could drop down to a vector when only one supported column remained, causing report outputs to lose the dataset introduction and variable name.
Changes:
- Preserve data-frame structure during list-column filtering by keeping
drop = FALSEin both grouped and ungrouped paths. - Improve robustness of diagnostic/performance text and stabilize
lavaan/stanregtests by reducing snapshot brittleness. - Update CI workflows (coverage, random test order, R CMD check) and add ancillary repo hygiene updates (wordlist, link check exclude, docs tweaks).
| File | Description |
|---|---|
| vignettes/report_ai.Rmd | Small wording/spelling update in AI vignette text. |
| tests/testthat/test-report_intercept.R | Adjusts global assignments with lintr suppression and whitespace cleanup. |
| tests/testthat/test-report_diagnostics.R | Adds regression tests for lavaan fit text formatting and Bayesian diagnostic text generation. |
| tests/testthat/test-report.stanreg.R | Updates snapshot to disable diagnostics and adds posterior/diagnostic consistency test. |
| tests/testthat/test-report.lavaan.R | Replaces brittle snapshots with normalized/validated comparisons for GFI-related output. |
| tests/testthat/test-report.data.frame.R | Updates row-count assertions and adds regression test for single-column data-frame reporting. |
| tests/testthat/_snaps/windows/report.stanreg.md | Updates snapshot output to match new include_diagnostic = FALSE call. |
| tests/testthat/_snaps/windows/report.lavaan.md | Updates snapshots to reflect normalized <GFI> placeholder and corrected values. |
| lychee.toml | Excludes a Cloudflare-challenged URL from link checking. |
| inst/WORDLIST | Adds new accepted words used in docs/tests. |
| README.md | Adjusts GitHub stars badge link target. |
| README.Rmd | Adjusts GitHub stars badge link target (source Rmd). |
| R/report_performance.R | Fixes formatting to preserve sign/integer part when rendering fit indices. |
| R/report_parameters.R | Supports multiple ESS column conventions and improves only_when_insufficient filtering. |
| R/report.data.frame.R | Ensures list-column filtering retains a data frame via drop = FALSE. |
| NEWS.md | Documents the data-frame preservation fix and diagnostic formatting improvements. |
| .github/workflows/test-coverage.yml | Replaces reusable workflow with an explicit Windows coverage workflow and RStan pins. |
| .github/workflows/check-random-test-order.yml | Adds explicit randomized test-order workflow with reporting. |
| .github/workflows/R-CMD-check.yml | Replaces reusable workflow with explicit compatibility-matrix checks and dependency pinning. |
| .Rbuildignore | Excludes lychee.toml from package builds. |
Review effort: Lite
| ) | ||
| expect_identical(unique(as.data.frame(result)$Variable), names(data)[1]) | ||
| expect_identical( | ||
| unique(summary(as.data.frame(result))$Variable), |
| expect_match( | ||
| as.character(result), | ||
| "The data contains 5 observations of the following 1 variables:", | ||
| fixed = TRUE | ||
| ) | ||
| expect_match( | ||
| as.character(result), |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #620 +/- ##
===========================================
+ Coverage 72.36% 87.31% +14.94%
===========================================
Files 54 55 +1
Lines 3684 5044 +1360
===========================================
+ Hits 2666 4404 +1738
+ Misses 1018 640 -378 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
2e8fb6d to
9b98b9c
Compare
9b98b9c to
2e3d35c
Compare
|
This PR fixes data-frame reports that lose their format when only one supported column remains. I rebased onto |
2e3d35c to
c647647
Compare
|
Rebased the fix for one-column data-frame reports onto current |


Filtering list columns dropped a single remaining column to a vector. A one-column data frame then lost the dataset introduction and variable name in reports.
Keep
drop = FALSEin both filtering paths. Regression tests cover single numeric and factor columns, plus a data frame reduced to one supported column after removing a list column, checking full and summary tables.Validation
All 38 focused data-frame assertions passed on the rebased branch. Air and the CI lintr revision passed on the changed R files. The Windows release check hits the mixed-model snapshot failure reproduced by the current main check.
The changed-files lint check prompted replacing seven row-count assertions with compatible length checks.