-
Notifications
You must be signed in to change notification settings - Fork 1k
Enhance error message for invalid measure.vars in melt #6767
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6767 +/- ##
=======================================
Coverage 98.59% 98.59%
=======================================
Files 79 79
Lines 14664 14674 +10
=======================================
+ Hits 14458 14468 +10
Misses 206 206 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good start
please fix issues
73f7f45
to
3c1a7c6
Compare
2273004
to
e75bc73
Compare
@tdhock , Please let me know if there is any change or improvement needed . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when you push changes, please just push new commits instead of rewriting history and force pushing
dbcabb0
to
ea98c19
Compare
Please click "Resolve conversation" when you have made changes to address reviewer comments. Please add or edit test cases to reflect the new error messages. |
@tdhock , there is some error when i use test case , can i close this PR?? |
I don't understand, can you please clarify? |
One or more values in 'id.vars' are invalid; please fix by removing: [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0], [0 ] this type of error is coming , i don't know how to solve it . |
can i make tests/testthat/test_melt.R file where we add test to reflect the new error message |
we do not use the testthat framework. See |
A merge conflict happens when commits on separate branches edit the same file in incompatible ways. For example, two commits both adding something at the end of a file is a conflict because it's unclear which edit should go first. Please undo 11345b9 because it reverts useful changes to tests made on |
This reverts commit 11345b9.
Since base::.formula2varlist is not an API and it is now needed in two places, provide our own implementation.
Produce the class header from `toprint` instead of just `x`. Fixes: Rdatatable#6806 Co-authored-by: Ivan K <[email protected]>
I resolve all conflict in vs code editor but here it shows confict. |
In order to prevent conflicts in a future merge of your branch into
master, it was needed to merge master into your branch (and solve the
resulting conflicts).
|
Hey @joshhwuu, Just wanted to check in—are there any updates on the PR merge? Let me know if anything needs to be addressed. Thanks! |
# test for enhancing error message of invalid column #6512 | ||
test(2308, { | ||
melt(data.table(A = 1:5, B = 6:10), id.vars = c("A", "-1")) | ||
}, error = "One or more values in 'id.vars' are invalid") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test case is irrelevant.
please add test cases for the new functionality.
Hi Divendra, just checking in—has there been any progress on this? |
No, If you interested that you can |
Fixes #6512
It provides more informative error messages, better handling of edge cases, and an optimized, clean implementation. These changes enhance the overall user experience and make the function more robust in various use cases.
Benefits:
Improved Error Reporting: Users will receive more specific error messages indicating exactly which columns are invalid and need to be removed.
Better Performance:The function has been optimized for speed, particularly when dealing with large datasets.
Enhanced User Experience:The improved error messages and optimized performance lead to a better user experience when using the function in practical applications.
Testing and Validation:
Valid Inputs:The function works as expected when provided with valid column numbers, returning the unique columns.
Invalid Inputs:The function will raise an error with a detailed message if any columns are invalid, listing the problematic values.
NA_INTEGER Handling: When is_measure is true, NA_INTEGER is treated as a valid value, and the function behaves accordingly.
Edge Cases:The function has been tested with edge cases, such as empty inputs or all invalid columns, to ensure robustness.
Replace the message
"One or more values in 'measure.vars' is invalid" by
"One or more values in 'measure.vars' in invalid ; please fix by removing: %s"
it gives the specific details of error.