From 0347036e731667607910dcb3279155c5fe4eba9b Mon Sep 17 00:00:00 2001 From: Deepyaman Datta Date: Wed, 1 Nov 2023 20:46:59 -0600 Subject: [PATCH] refactor(sql): align logic for filtered reductions --- ibis/backends/base/sql/registry/aggregate.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ibis/backends/base/sql/registry/aggregate.py b/ibis/backends/base/sql/registry/aggregate.py index a60aff697b3f..f9adb6318526 100644 --- a/ibis/backends/base/sql/registry/aggregate.py +++ b/ibis/backends/base/sql/registry/aggregate.py @@ -1,18 +1,16 @@ from __future__ import annotations -import itertools - import ibis import ibis.expr.operations as ops -def _reduction_format(translator, func_name, where, arg, *args): +def _reduction_format(translator, func_name, where, *args): if where is not None: - arg = ops.IfElse(where, arg, ibis.NA) + args = (ops.IfElse(where, arg, ibis.NA) for arg in args) return "{}({})".format( func_name, - ", ".join(map(translator.translate, itertools.chain([arg], args))), + ", ".join(map(translator.translate, args)), )