Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patterns() throws new informative error when cols is non-character or has NA #6511

Merged
merged 5 commits into from
Sep 24, 2024

Conversation

tdhock
Copy link
Member

@tdhock tdhock commented Sep 20, 2024

before this PR

> melt(data.table(x1=1,x2=2,y1=3,y2=4),measure.vars=patterns("2",cols=NA_character_))
Error in (function (..., cols = character(0L), ignore.case = FALSE, perl = FALSE,  : 
  Pattern not found: [[2]]

above is not very informative for the user.

after this PR

> melt(data.table(x1=1,x2=2,y1=3,y2=4),measure.vars=patterns("2",cols=NA_character_))
Error in (function (..., cols = character(0L), ignore.case = FALSE, perl = FALSE,  : 
  cols must be a character vector of column names

above is more helpful for the user, and consistent with the error message in measure().

Copy link

github-actions bot commented Sep 20, 2024

Comparison Plot

Generated via commit eac1f8a

Download link for the artifact containing the test results: ↓ atime-results.zip

Time taken to finish the standard R installation steps: 3 minutes and 32 seconds

Time taken to run atime::atime_pkg on the tests: 8 minutes and 15 seconds

R/fmelt.R Outdated Show resolved Hide resolved
Copy link
Member

@MichaelChirico MichaelChirico left a comment

Choose a reason for hiding this comment

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

Great find & fix!

@tdhock
Copy link
Member Author

tdhock commented Sep 24, 2024

thanks!

@tdhock tdhock merged commit 7bb4862 into master Sep 24, 2024
8 checks passed
@MichaelChirico MichaelChirico deleted the patterns-cols-errors branch September 24, 2024 04:33
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