HyukjinKwon commented on a change in pull request #28907:
URL: https://github.com/apache/spark/pull/28907#discussion_r444161548
##########
File path: R/pkg/R/utils.R
##########
@@ -529,7 +529,10 @@ processClosure <- function(node, oldEnv, defVars,
checkedFuncs, newEnv) {
# Namespaces other than "SparkR" will not be searched.
if (!isNamespace(func.env) ||
(getNamespaceName(func.env) == "SparkR" &&
- !(nodeChar %in% getNamespaceExports("SparkR")))) {
+ !(nodeChar %in% getNamespaceExports("SparkR")) &&
+ # Note that generic S4 methods should not be set to the
environment of
+ # cleaned closure. It does not work with R 4.0.0+. See also
SPARK-31918.
+ nodeChar != "" && !methods::isGeneric(nodeChar, func.env))) {
Review comment:
`nodeChar` can be empty strings, and `isGeneric` rejects empty strings.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]