We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 50b4328 commit 5bdb436Copy full SHA for 5bdb436
1 file changed
python/datafusion/dataframe.py
@@ -531,18 +531,7 @@ def aggregate(
531
group_by_list = group_by if isinstance(group_by, list) else [group_by]
532
aggs_list = aggs if isinstance(aggs, list) else [aggs]
533
534
- group_by_exprs = []
535
- for e in group_by_list:
536
- if isinstance(e, str):
537
- group_by_exprs.append(Expr.column(e).expr)
538
- elif isinstance(e, Expr):
539
- group_by_exprs.append(e.expr)
540
- else:
541
- error = (
542
- "Expected Expr or column name, found:"
543
- f" {type(e).__name__}. Use col() or lit() to construct expressions"
544
- )
545
- raise TypeError(error)
+ group_by_exprs = expr_list_to_raw_expr_list(group_by_list)
546
aggs_exprs = []
547
for agg in aggs_list:
548
if not isinstance(agg, Expr):
0 commit comments