Skip to content

Commit

Permalink
fix: any() on empty set now correctly returns False (#471)
Browse files Browse the repository at this point in the history
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> 🦕
  • Loading branch information
TrevorBergeron authored Mar 19, 2024
1 parent 4e8e97d commit f55680c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bigframes/core/compile/aggregate_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def _(
result = _is_true(column).any()
return cast(
ibis_types.BooleanScalar,
_apply_window_if_present(result, window).fillna(ibis_types.literal(True)),
_apply_window_if_present(result, window).fillna(ibis_types.literal(False)),
)


Expand Down
4 changes: 4 additions & 0 deletions tests/system/small/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ def test_index_has_duplicates(scalars_df_index, scalars_pandas_df_index):
assert bf_result == pd_result


def test_index_empty_has_duplicates():
assert not bpd.Index([]).has_duplicates


def test_index_values(scalars_df_index, scalars_pandas_df_index):
bf_result = scalars_df_index.index.values
pd_result = scalars_pandas_df_index.index.values
Expand Down

0 comments on commit f55680c

Please sign in to comment.