Skip to content

Conversation

@strengejacke
Copy link
Member

@strengejacke strengejacke commented Sep 5, 2025

  • No longer removes widened columns when these were NA only
  • Remove values_fill argument, as this never worked as probably intended
  • allow select-helpers for values_from
  • validate input arguments

This one replaces #645

@etiennebacher
Copy link
Member

All sound good to me, I hadn't noticed the different behavior from tidyr on filling missing values.

Instead of removing values_fill entirely, can you add a message explaining that the argument is defunct and that the user should handle missings on their own instead?

@strengejacke
Copy link
Member Author

Haha, our internal select-helper only works when the variable is named select?

@strengejacke
Copy link
Member Author

Ah, found the solution, via substitute.

@strengejacke strengejacke marked this pull request as ready for review September 5, 2025 21:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR revises the data_to_wide() function to remove the non-functional values_fill argument, preserve empty columns after widening, and add support for select-helpers in values_from.

  • Remove defunct values_fill functionality and deprecate the argument
  • Stop removing empty columns created during widening process to align with tidyr::pivot_wider() behavior
  • Add select-helper support for values_from parameter with new ignore_case and regex arguments

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
R/data_to_wide.R Core function updates: remove values_fill logic, add validation, implement select-helpers
man/data_to_wide.Rd Update documentation to reflect argument changes and new functionality
tests/testthat/test-data_to_wide.R Replace values_fill tests with deprecation tests, add validation and empty column preservation tests
NEWS.md Document breaking changes and new features
DESCRIPTION Version bump

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@strengejacke
Copy link
Member Author

Most changed lines are actually Air-styler-stuff.

@etiennebacher
Copy link
Member

Most changed lines are actually Air-styler-stuff.

Can you revert those? It makes the PR hard to review. I'd like to use Air everywhere in easystats, let's just discuss that in the easystats repo and then make a PR dedicated to that if we choose to use it.

@strengejacke
Copy link
Member Author

Ok, done. Ready for review

Copy link
Member

@etiennebacher etiennebacher left a comment

Choose a reason for hiding this comment

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

Thank you, LGTM overall, just a few small comments to address.

@etiennebacher etiennebacher changed the title Revise data_to_wide() data_to_wide(): disable arg values_fill, do not drop empty columns, allow select helpers Sep 6, 2025
@codecov
Copy link

codecov bot commented Sep 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.83%. Comparing base (9a624b1) to head (3e96518).
⚠️ Report is 22 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #646      +/-   ##
==========================================
+ Coverage   91.73%   91.83%   +0.09%     
==========================================
  Files          76       76              
  Lines        6410     6476      +66     
==========================================
+ Hits         5880     5947      +67     
+ Misses        530      529       -1     

☔ View full report in Codecov by Sentry.
📢 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.

@etiennebacher etiennebacher merged commit be8875c into main Sep 6, 2025
26 of 27 checks passed
@etiennebacher etiennebacher deleted the revise_data_to_wide2 branch September 6, 2025 09:37
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.

3 participants