nealrichardson commented on code in PR #14361:
URL: https://github.com/apache/arrow/pull/14361#discussion_r992343327


##########
r/R/expression.R:
##########
@@ -173,7 +173,12 @@ Expression$create <- function(function_name,
   assert_that(is.string(function_name))
   assert_that(is_list_of(args, "Expression"), msg = "Expression arguments must 
be Expression objects")
   expr <- compute___expr__call(function_name, args, options)
-  expr$schema <- unify_schemas(schemas = lapply(args, function(x) x$schema))
+  if (length(args)) {
+    expr$schema <- unify_schemas(schemas = lapply(args, function(x) x$schema))
+  } else {
+    # TODO: this shouldn't be necessary
+    expr$schema <- schema()
+  }

Review Comment:
   `random()`, though it does not yet work, is our first nullary compute 
function, so args is length 0, and unify_schemas assumes at least one schema. 
Before I got to the point of finding that random() doesn't evaluate correctly, 
I hit an error here. (The TODO is more a grumble for my future self, I have a 
jira to refactor some of this expression schema tracking business.)



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to