Skip to content

Commit 4429614

Browse files
committed
Add comments to clarify table normalization in aggregate tests
1 parent 7bc303d commit 4429614

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

examples/datafusion-ffi-example/python/tests/_test_aggregate_udf.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ def test_ffi_aggregate_register():
4848
assert result
4949
assert result[0].num_columns == 1
5050

51+
# Normalizing table registration in _normalize_table_provider feeds the Rust layer
52+
# an actual TableProvider, so collect() emits the grouped rows in a single record batch
53+
# instead of two separate batches.
5154
aggregates = pa.concat_arrays([batch.column(0) for batch in result])
5255

5356
assert len(aggregates) == 2
@@ -57,11 +60,14 @@ def test_ffi_aggregate_register():
5760
def test_ffi_aggregate_call_directly():
5861
ctx = setup_context_with_table()
5962
my_udaf = udaf(MySumUDF())
60-
63+
6164
result = (
6265
ctx.table("test_table").aggregate([col("b")], [my_udaf(col("a"))]).collect()
6366
)
6467

68+
# Normalizing table registration in _normalize_table_provider feeds the Rust layer
69+
# an actual TableProvider, so collect() emits the grouped rows in a single record batch
70+
# instead of two separate batches.
6571
assert result
6672
assert result[0].num_columns == 2
6773

0 commit comments

Comments
 (0)