fix: include offending values in mapping_section assertion error (#1367) - #1416
Open
wangzhengdna-lang wants to merge 1 commit into
Open
Conversation
…rmaverse#1367) The assertion in .column_mapping_section() threw a generic message when mapping_df contained zero or multiple mapping_section values, giving no clue about the actual content. The error now reports the count and the offending values, e.g.: mapping_df must contain exactly one unique mapping_section value, but found 2: PK, PD
wangzhengdna-lang
requested review from
Gero1999,
Shaakon35 and
h5hoang
as code owners
August 5, 2026 04:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Closes #1367
Description
The assertion in
.column_mapping_section()(inst/shiny/modules/tab_data/data_mapping.R) threw a generic message whenmapping_dfcontained zero or multiplemapping_sectionvalues, giving no clue about the actual content. The error now reports the count and the offending values, e.g.:Definition of Done
mapping_sectionvalues foundHow to test
Defensive guard message change — exempt from unit tests per project convention. Verified manually by calling
.column_mapping_section()with a two-section data frame, which now produces the message shown above.Contributor checklist
.scsschange was done, rundata-raw/compile_css.Rdata-raw/test_suggests_hidden.RNotes to reviewer
One-line error message improvement; full test suite 2005 PASS / 0 FAIL locally, spellcheck clean.