Skip to content

99 create var from codelist bugfix#102

Merged
LiamHobby merged 11 commits intomainfrom
99-create-var-from-codelist-bugfix
Jan 26, 2026
Merged

99 create var from codelist bugfix#102
LiamHobby merged 11 commits intomainfrom
99-create-var-from-codelist-bugfix

Conversation

@LiamHobby
Copy link
Copy Markdown
Collaborator

Closes #99

This bug occurred only when there were multiple values from a numeric type input column that were not present in the codelist i.e., values of 99 and 999 in the dataset but no appropriate record in the CT.

The fix just required placing a cli::qty() check prior to the glue substitution that uses pluralization.

This wasn't caught in testing because the test case only had a single value of wrong CT in the test dataset. I have expanded the test cases to include both single and multiple bad CT for both character and numeric input.

@LiamHobby LiamHobby requested a review from bms63 November 21, 2025 08:37
@LiamHobby LiamHobby self-assigned this Nov 21, 2025
@LiamHobby LiamHobby added 0.3.0 Issues to be worked on for release 0.3.0 (est. Jan 2026). bug Something isn't working labels Nov 21, 2025
@LiamHobby
Copy link
Copy Markdown
Collaborator Author

@bms63 Could you take a look at this one please

Liam Hobby added 2 commits December 19, 2025 14:25
Merge branch '99-create-var-from-codelist-bugfix' of github.com:pharmaverse/metatools into 99-create-var-from-codelist-bugfix
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
Comment thread tests/testthat/test-codelist.R
Comment thread tests/testthat/test-codelist.R Outdated
Comment thread tests/testthat/test-codelist.R
Co-authored-by: Ben Straub <ben.x.straub@gsk.com>
@LiamHobby LiamHobby requested a review from bms63 January 19, 2026 12:38
@bms63
Copy link
Copy Markdown
Collaborator

bms63 commented Jan 21, 2026

will you add this bugfix to News.md at the end of the sprint?

looks good to me

@LiamHobby LiamHobby merged commit 7dd59ab into main Jan 26, 2026
11 checks passed
@LiamHobby LiamHobby deleted the 99-create-var-from-codelist-bugfix branch January 26, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.3.0 Issues to be worked on for release 0.3.0 (est. Jan 2026). bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

create_var_from_codelist throws error when strict==TRUE and input is numeric

2 participants