-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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
[SPARK-22281][SPARKR] Handle R method breaking signature changes #19557
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3236,7 +3236,7 @@ setMethod("as.data.frame", | |
#' | ||
#' @family SparkDataFrame functions | ||
#' @rdname attach | ||
#' @aliases attach,SparkDataFrame-method | ||
#' @aliases attach attach,SparkDataFrame-method | ||
#' @param what (SparkDataFrame) The SparkDataFrame to attach | ||
#' @param pos (integer) Specify position in search() where to attach. | ||
#' @param name (character) Name to use for the attached SparkDataFrame. Names | ||
|
@@ -3252,9 +3252,12 @@ setMethod("as.data.frame", | |
#' @note attach since 1.6.0 | ||
setMethod("attach", | ||
signature(what = "SparkDataFrame"), | ||
function(what, pos = 2, name = deparse(substitute(what)), warn.conflicts = TRUE) { | ||
newEnv <- assignNewEnv(what) | ||
attach(newEnv, pos = pos, name = name, warn.conflicts = warn.conflicts) | ||
function(what, pos = 2L, name = deparse(substitute(what), backtick = FALSE), | ||
warn.conflicts = TRUE) { | ||
args <- as.list(environment()) # capture all parameters - this must be the first line | ||
newEnv <- assignNewEnv(args$what) | ||
args$what <- newEnv | ||
do.call(attach, args) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. calling attach this way to avoid it getting flagged... |
||
}) | ||
|
||
#' Evaluate a R expression in an environment constructed from a SparkDataFrame | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
changing this to match the latest R-devel param signature
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.
So this is the only thing we might need to update if R changes something ? Also how does this keep working with the older R version as well
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 will need to be updated manually...
from my testing on r-release it's working against the older signature. I think for generic to work it just need to match the param names and order but not default value.
this does change the behavior a bit, from
name = deparse(substitute(what))
toname = deparse(substitute(what), backtick = FALSE)