Skip to content

fix: remove 'card' class after unlist_ard_columns() and rename_ard_columns()#566

Open
Melkiades wants to merge 2 commits into
insightsengineering:mainfrom
Melkiades:fix/remove-card-class-after-unlist-rename
Open

fix: remove 'card' class after unlist_ard_columns() and rename_ard_columns()#566
Melkiades wants to merge 2 commits into
insightsengineering:mainfrom
Melkiades:fix/remove-card-class-after-unlist-rename

Conversation

@Melkiades
Copy link
Copy Markdown
Contributor

@Melkiades Melkiades commented May 21, 2026

What changes are proposed in this pull request?

After unlisting or renaming, the result no longer satisfies the ARD contract (list columns have been flattened or group/variable columns renamed). The new subclasses signal this so that functions requiring a proper ARD (apply_fmt_fun(), replace_null_statistic(), etc.) will reject these objects with a clear error.

rename_ard_columns() now accepts both "card" and "card_unlisted" as input, supporting both rename |> unlist and unlist |> rename orderings.

Reference GitHub issue associated with pull request.

Closes #513


Pre-review Checklist (if item does not apply, mark is as complete)

  • All GitHub Action workflows pass with a ✅
  • PR branch has pulled the most recent updates from master branch: usethis::pr_merge_main()
  • If a bug was fixed, a unit test was added.
  • Code coverage is suitable for any new functions/features (generally, 100% coverage for new code): devtools::test_coverage()
  • Request a reviewer

Melkiades added 2 commits May 21, 2026 09:07
…lumns()

After unlisting or renaming, the result no longer satisfies the ARD
contract (list columns have been flattened or group/variable columns
renamed). Introduce 'card_unlisted' and 'card_renamed' subclasses
to signal this.

- unlist_ard_columns(): returns class 'card_unlisted'
- rename_ard_columns(): returns class 'card_renamed', accepts
  both 'card' and 'card_unlisted' as input
- Functions requiring a proper ARD (apply_fmt_fun, replace_null_statistic,
  etc.) continue to require class 'card' and will reject the new subclasses

Closes insightsengineering#513
@Melkiades Melkiades marked this pull request as ready for review May 22, 2026 14:07
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.

Remove card class after unlist_ard_columns()

1 participant