diff --git a/ibis/expr/types/relations.py b/ibis/expr/types/relations.py index 5ac48aa966296..fb8ea4c677c82 100644 --- a/ibis/expr/types/relations.py +++ b/ibis/expr/types/relations.py @@ -4432,7 +4432,13 @@ def pivot_wider( key = names_sep.join(filter(None, key_components)) aggs[key] = arg if values_fill is None else arg.coalesce(values_fill) - return self.group_by(id_cols).aggregate(**aggs) + id_cols = id_cols.expand(self) + + # no id columns, so do an ungrouped aggregation + if not id_cols: + return self.aggregate(**aggs) + + return self.group_by(*id_cols).aggregate(**aggs) def relocate( self,