Skip to content

Preserve data-frame reporting when one supported column remains - #620

Merged
strengejacke merged 2 commits into
easystats:mainfrom
M-Colley:codex/fix-single-column-data-frame
Dec 4, 2026
Merged

strengejacke merged 2 commits into
easystats:mainfrom
M-Colley:codex/fix-single-column-data-frame

Conversation

@M-Colley

@M-Colley M-Colley commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

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 = FALSE in 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.

Copilot AI balanced review requested due to automatic review settings November 18, 2026 12:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 = FALSE in both grouped and ungrouped paths.
  • Improve robustness of diagnostic/performance text and stabilize lavaan/stanreg tests 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

Comment thread tests/testthat/test-report.data.frame.R Outdated
)
expect_identical(unique(as.data.frame(result)$Variable), names(data)[1])
expect_identical(
unique(summary(as.data.frame(result))$Variable),
Comment thread tests/testthat/test-report.data.frame.R Outdated
Comment on lines +116 to +122
expect_match(
as.character(result),
"The data contains 5 observations of the following 1 variables:",
fixed = TRUE
)
expect_match(
as.character(result),
@codecov

codecov Bot commented Nov 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.10526% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.31%. Comparing base (58c7492) to head (2e8fb6d).
⚠️ Report is 95 commits behind head on main.

Files with missing lines Patch % Lines
R/report.data.frame.R 50.00% 3 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@M-Colley
M-Colley force-pushed the codex/fix-single-column-data-frame branch from 2e8fb6d to 9b98b9c Compare December 3, 2026 12:19
@strengejacke strengejacke added the Revision required A review has been submitted and changes requested. label Dec 3, 2026
@M-Colley
M-Colley force-pushed the codex/fix-single-column-data-frame branch from 9b98b9c to 2e3d35c Compare December 3, 2026 22:09
@M-Colley

M-Colley commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

This PR fixes data-frame reports that lose their format when only one supported column remains. I rebased onto main and revised the regression to check the report table and its summary directly. All 38 focused assertions passed.

@M-Colley
M-Colley force-pushed the codex/fix-single-column-data-frame branch from 2e3d35c to c647647 Compare December 4, 2026 11:31
@M-Colley

M-Colley commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

Rebased the fix for one-column data-frame reports onto current main. report() keeps its data-frame output when filtering unsupported columns leaves one supported column. The focused tests and local package check passed.

@strengejacke
strengejacke merged commit 65eb2b0 into easystats:main Dec 4, 2026
8 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Revision required A review has been submitted and changes requested.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants