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

more verbose merge errors #6689

Closed
wants to merge 1 commit into from

Conversation

KyleHaynes
Copy link
Contributor

@KyleHaynes KyleHaynes commented Dec 23, 2024

@MichaelChirico addressing #6556, let me know what you think.

Would you generally update NEWS.md or do any tests for something like this? Happy to do either.

require(data.table)
a = data.table(a = letters, b = letters)
b = data.table(c = letters, b = letters)

merge(a, b, by = c("a", "b"))
# Error in merge.data.table(a, b, by = c("a", "b")) :
#   Elements listed in `by` must be valid column names in x and y.
#   Missing from `y`: a
merge(a, b, by = c("a", "b", "dd"))
# Error in merge.data.table(a, b, by = c("a", "b", "dd")) :
#   Elements listed in `by` must be valid column names in x and y.
#   Missing from `x`: dd
#   Missing from `y`: a, dd
merge(a, b, by = c("a"))
# Error in merge.data.table(a, b, by = c("a")) :
#   Elements listed in `by` must be valid column names in x and y.
#   Missing from `y`: a
merge(a, b, by.x = c("a"), by.y = c("a"))
# Error in merge.data.table(a, b, by.x = c("a"), by.y = c("a")) :
#   Elements listed in `by.y` must be valid column names in y.
#   Missing from `y`: a

Fixes #6556

@KyleHaynes
Copy link
Contributor Author

@MichaelChirico - going to close this, will resubmit (in a day or 2) and attempt to close off a few more (e.g. #6512).

@KyleHaynes KyleHaynes closed this Dec 23, 2024
Copy link

codecov bot commented Dec 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.62%. Comparing base (e4b0bbb) to head (e8c9fe8).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6689   +/-   ##
=======================================
  Coverage   98.61%   98.62%           
=======================================
  Files          79       79           
  Lines       14559    14571   +12     
=======================================
+ Hits        14358    14370   +12     
  Misses        201      201           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

[feature request] diagnostic for merge.data.table when by = key is not present in dt being merged
1 participant