HyukjinKwon commented on a change in pull request #26429: [SPARK-29777][SparkR] 
SparkR::cleanClosure aggressively removes a function required by user function
URL: https://github.com/apache/spark/pull/26429#discussion_r346162361
 
 

 ##########
 File path: R/pkg/tests/fulltests/test_utils.R
 ##########
 @@ -110,6 +110,15 @@ test_that("cleanClosure on R functions", {
   actual <- get("y", envir = env, inherits = FALSE)
   expect_equal(actual, y)
 
+  # Test for combination for nested and sequenctial functions in a closure
+  f1 <- function(x) x + 1
+  f2 <- function(x) f1(x) + 2
+  user_func <- function(x) { f1(x); f2(x) }
+  c_user_func_env <- environment(cleanClosure(user_func))
 
 Review comment:
   BTW, I think naming `c_user_func_env` is not preferred (it was discussed 
here https://github.com/apache/spark/pull/17590#issuecomment-293732796) before.
   I think it should rather be `cUserFuncEnv`.
   
   Google guide seems updated rapidly 
(https://google.github.io/styleguide/Rguide.html).. We will have to update the 
guide ... 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to