Uh oh!
There was an error while loading. Please reload this page.
[SPARK-31571][R] Overhaul stop/message/warning calls to be more canonical - #28365
[SPARK-31571][R] Overhaul stop/message/warning calls to be more canonical#28365MichaelChirico wants to merge 18 commits into
Conversation
| specialtype <- specialtypeshandle(x) | ||
| if (is.null(specialtype)) { | ||
| stop(paste("Unsupported data type: ", x)) | ||
| stop("Unsupported data type: ", x) |
There was a problem hiding this comment.
here, paste was creating an extra space, now fixed
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
HyukjinKwon
commented
Apr 27, 2020
add to whitelist |
HyukjinKwon
commented
Apr 27, 2020
ok to test |
SparkQA
commented
Apr 27, 2020
Test build #121897 has finished for PR 28365 at commit
|
SparkQA
commented
Apr 27, 2020
Test build #121900 has finished for PR 28365 at commit
|
HyukjinKwon
commented
Apr 28, 2020
cc @felixcheung and @shivaram FYI |
SparkQA
commented
Apr 28, 2020
Test build #121941 has finished for PR 28365 at commit
|
MichaelChirico
commented
Apr 28, 2020
Not sure why the Documents task failed, looks like the |
MichaelChirico
commented
Apr 28, 2020
I would leave the JVM stuff to the developers working more closely with that code base. Translations only have to be updated at release time & the marginal cost from release to release would generally be low. Anyway let's table that since you're right it's a bit premature. I'll split off the gettextf changes in a while |
| "left", "leftouter", "left_outer", | ||
| "right", "rightouter", "right_outer", | ||
| "semi", "left_semi", "leftsemi", "anti", "left_anti", "leftanti")) { | ||
| "semi", "left_semi", "leftsemi", "anti", "left_anti", "leftanti") |
There was a problem hiding this comment.
noting here that i changed this error message slightly (removed the or and aligned the ordering (leftsemi/left_semi and leftanti/left_anti are swapped vis-a-vis the %in% condition).
it may be preferable to just change the test not to be so exact. LMK
MichaelChirico
commented
Apr 29, 2020
@HyukjinKwon have reverted all |
SparkQA
commented
Apr 29, 2020
Test build #122025 has finished for PR 28365 at commit
|
SparkQA
commented
Apr 29, 2020
Test build #122031 has finished for PR 28365 at commit
|
SparkQA
commented
Apr 29, 2020
Test build #122037 has finished for PR 28365 at commit
|
SparkQA
commented
Apr 29, 2020
Test build #122040 has finished for PR 28365 at commit
|
srowen
left a comment
There was a problem hiding this comment.
If it's just improving the code, seems fine.
Uh oh!
There was an error while loading. Please reload this page.
SparkQA
commented
Apr 29, 2020
Test build #122085 has finished for PR 28365 at commit
|
HyukjinKwon
left a comment
There was a problem hiding this comment.
Looks okay but would need a closer look from me or somebody else.
Uh oh!
There was an error while loading. Please reload this page.
| if (!(is.logical(value) || is.numeric(value) || is.character(value) || is.null(value))) { | ||
| stop(paste0("Unsupported type for ", name, " : ", class(value), | ||
| ". Supported types are logical, numeric, character and NULL."), call. = FALSE) | ||
| stop("Unsupported type for ", name, " : ", toString(class(value)), ". ", |
There was a problem hiding this comment.
Quick question, why do we need to do toString? Were there any differences at stop(paste(..., ...)) vs stop(..., ...)?
There was a problem hiding this comment.
stop uses sep='', so stop(paste0(...)) is equivalent to stop(...)
toString collapses in cases length>1, compare:
stop(toString(class(Sys.time())))
stop(class(Sys.time()))
SparkQA
commented
May 1, 2020
Test build #122167 has finished for PR 28365 at commit
|
…ical
### What changes were proposed in this pull request?
Internal usages like `{stop,warning,message}({paste,paste0,sprintf}` and `{stop,warning,message}(some_literal_string_as_variable` have been removed and replaced as appropriate.
### Why are the changes needed?
CRAN policy recommends against using such constructions to build error messages, in particular because it makes the process of creating portable error messages for the package more onerous.
### Does this PR introduce any user-facing change?
There may be some small grammatical changes visible in error messaging.
### How was this patch tested?
Not done
Closes#28365 from MichaelChirico/r-stop-paste.
Authored-by: Michael Chirico <michael.chirico@grabtaxi.com>
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
(cherry picked from commit f53d8c6)
Signed-off-by: HyukjinKwon <gurwls223@apache.org>HyukjinKwon
commented
May 3, 2020
Merged to master and branch-3.0. |
…ical
### What changes were proposed in this pull request?
Internal usages like `{stop,warning,message}({paste,paste0,sprintf}` and `{stop,warning,message}(some_literal_string_as_variable` have been removed and replaced as appropriate.
### Why are the changes needed?
CRAN policy recommends against using such constructions to build error messages, in particular because it makes the process of creating portable error messages for the package more onerous.
### Does this PR introduce any user-facing change?
There may be some small grammatical changes visible in error messaging.
### How was this patch tested?
Not done
Closesapache#28365 from MichaelChirico/r-stop-paste.
Authored-by: Michael Chirico <michael.chirico@grabtaxi.com>
Signed-off-by: HyukjinKwon <gurwls223@apache.org>
What changes were proposed in this pull request?
Internal usages like
{stop,warning,message}({paste,paste0,sprintf}and{stop,warning,message}(some_literal_string_as_variablehave been removed and replaced as appropriate.Why are the changes needed?
CRAN policy recommends against using such constructions to build error messages, in particular because it makes the process of creating portable error messages for the package more onerous.
Does this PR introduce any user-facing change?
There may be some small grammatical changes visible in error messaging.
How was this patch tested?
Not done