Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion dask_sql/physical/rex/core/call.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,13 @@ def reduce(self, *operands, **kwargs):
)
):
operands = tuple(map(as_timelike, operands))
return reduce(partial(self.operation, **kwargs), operands)
try:
return reduce(partial(self.operation, **kwargs), operands)
except ValueError:
return reduce(
partial(self.operation, **kwargs),
(operands[0], float(operands[1][operands[1].columns[0]].loc[0].compute()))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd imagine we'd want to generalize the typecast here to handle other potential aggregating functions, but ATM can't think of an immediate way to do this.

)
else:
return self.unary_operation(*operands, **kwargs)

Expand Down