You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by felixcheung <gi...@git.apache.org> on 2017/10/25 05:21:49 UTC

[GitHub] spark pull request #19557: [SPARK-22281][SPARKR][WIP] Handle R method breaki...

Github user felixcheung commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19557#discussion_r146757193
  
    --- Diff: R/pkg/R/DataFrame.R ---
    @@ -3249,9 +3249,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)
    --- End diff --
    
    calling attach this way to avoid it getting flagged...


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org