Skip to content

Commit

Permalink
fix(ir): handle renaming for scalar operations
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Nov 20, 2023
1 parent c6a6c56 commit 6f77f17
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ibis/expr/types/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1247,9 +1247,15 @@ def as_table(self) -> ir.Table:
op = self.op()
table = find_first_base_table(op)
if table is not None:
return table.to_expr().aggregate([self])
return table.to_expr().aggregate(**{self.get_name(): self})
else:
return ops.DummyTable(values=(op,)).to_expr()
if isinstance(op, ops.Alias):
value = op
assert value.name == self.get_name()
else:
value = ops.Alias(op, self.get_name())

return ops.DummyTable(values=(value,)).to_expr()

def __deferred_repr__(self):
return f"<scalar[{self.type()}]>"
Expand Down

0 comments on commit 6f77f17

Please sign in to comment.