From 67e3d34cc180d11181b92ac3fb801765078fe19f Mon Sep 17 00:00:00 2001 From: Jonathan Date: Fri, 5 Jul 2024 16:50:22 +0100 Subject: [PATCH] - fixes pandas backend for groupby on column containing null values: for consistency with other backends (duck, postgres), NULL should be included in output groups --- ibis/backends/pandas/executor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ibis/backends/pandas/executor.py b/ibis/backends/pandas/executor.py index a3153d17b8b47..38f80e82c8cc5 100644 --- a/ibis/backends/pandas/executor.py +++ b/ibis/backends/pandas/executor.py @@ -623,7 +623,7 @@ def visit(cls, op: ops.DropColumns, parent, columns_to_drop): @classmethod def visit(cls, op: PandasAggregate, parent, groups, metrics): if groups: - parent = parent.groupby([col.name for col in groups.values()]) + parent = parent.groupby([col.name for col in groups.values()], dropna=False) metrics = {k: parent.apply(v) for k, v in metrics.items()} result = cls.concat(metrics, axis=1).reset_index() renames = {v.name: k for k, v in op.groups.items()}