Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit cbf27fe

Browse files
committed
test: add verification for empty selection aggregate projections
1 parent ee4e279 commit cbf27fe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/system/small/test_dataframe.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6283,3 +6283,11 @@ def test_agg_with_dict_containing_non_existing_col_raise_key_error(scalars_dfs):
62836283

62846284
with pytest.raises(KeyError):
62856285
bf_df.agg(agg_funcs)
6286+
6287+
6288+
def test_dataframe_count_empty_selection_succeeds(session):
6289+
# Tests that aggregate ops on empty selections don't trigger invalid empty SELECT syntax
6290+
df = session.read_gbq("SELECT 1 AS int_col")
6291+
empty_df = df[[]]
6292+
count_series = empty_df.count().to_pandas()
6293+
assert len(count_series) == 0

0 commit comments

Comments
 (0)