dragosmg commented on a change in pull request #11758:
URL: https://github.com/apache/arrow/pull/11758#discussion_r754966469
##########
File path: r/tests/testthat/test-data-type.R
##########
@@ -390,8 +390,8 @@ test_that("decimal type and validation", {
expect_error(decimal(4))
expect_error(decimal(4, "two"), '"scale" must be an integer')
expect_error(decimal(NA, 2), '"precision" must be an integer')
- expect_error(decimal(0, 2), "Invalid: Decimal precision out of range: 0")
- expect_error(decimal(100, 2), "Invalid: Decimal precision out of range: 100")
+ expect_error(decimal(0, 2), "\"precision\" must be greater than 0")
+ expect_error(decimal(100, 2), "\"precision\" must be less than or equal to
38")
Review comment:
Agree on consistency. However, I'm not a huge fan of the current error
message (surfaced from C++) as it doesn't tell the user what they need to do to
prevent the error. `decimal precision out of range` is not informative if we
don't tell them anything about said `range`. It reminds me of frustrating
account creating experiences when the password isn't "correct", but you don't
know what wrong with it and therefore correction requires a lot of trial and
error.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]