Skip to content

Commit f55680c

Browse files
fix: any() on empty set now correctly returns False (#471)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes #<issue_number_goes_here> 🦕
1 parent 4e8e97d commit f55680c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

bigframes/core/compile/aggregate_compiler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ def _(
414414
result = _is_true(column).any()
415415
return cast(
416416
ibis_types.BooleanScalar,
417-
_apply_window_if_present(result, window).fillna(ibis_types.literal(True)),
417+
_apply_window_if_present(result, window).fillna(ibis_types.literal(False)),
418418
)
419419

420420

tests/system/small/test_index.py

+4
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ def test_index_has_duplicates(scalars_df_index, scalars_pandas_df_index):
6868
assert bf_result == pd_result
6969

7070

71+
def test_index_empty_has_duplicates():
72+
assert not bpd.Index([]).has_duplicates
73+
74+
7175
def test_index_values(scalars_df_index, scalars_pandas_df_index):
7276
bf_result = scalars_df_index.index.values
7377
pd_result = scalars_pandas_df_index.index.values

0 commit comments

Comments
 (0)