Skip to content

Commit b73b649

Browse files
add test, fix assert spacing, remove unnecessary coalesce
1 parent eae36b8 commit b73b649

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

bigframes/core/compile/ibis_compiler/scalar_op_registry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ def isin_op_impl(x: ibis_types.Value, op: ops.IsInOp):
10621062
if op.match_nulls and contains_nulls:
10631063
return x.isnull() | x.isin(matchable_ibis_values)
10641064
else:
1065-
return x.isin(matchable_ibis_values).fillna(False)
1065+
return x.isin(matchable_ibis_values)
10661066

10671067

10681068
@scalar_op_compiler.register_unary_op(ops.ToDatetimeOp, pass_op=True)

tests/system/small/engines/test_generic_ops.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,4 +421,5 @@ def test_engines_isin_op(scalars_array_value: array_value.ArrayValue, engine):
421421
arr = arr.rename_columns(
422422
{old_name: new_names[i] for i, old_name in enumerate(col_ids)}
423423
)
424+
424425
assert_equivalence_execution(arr.node, REFERENCE_ENGINE, engine)

tests/system/small/test_dataframe.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1591,7 +1591,7 @@ def test_itertuples(scalars_df_index, index, name):
15911591
assert bf_tuple == pd_tuple
15921592

15931593

1594-
def test_df_isin_list(scalars_dfs):
1594+
def test_df_isin_list_w_null(scalars_dfs):
15951595
scalars_df, scalars_pandas_df = scalars_dfs
15961596
values = ["Hello, World!", 55555, 2.51, pd.NA, True]
15971597
bf_result = (
@@ -1606,6 +1606,21 @@ def test_df_isin_list(scalars_dfs):
16061606
pandas.testing.assert_frame_equal(bf_result, pd_result.astype("boolean"))
16071607

16081608

1609+
def test_df_isin_list_wo_null(scalars_dfs):
1610+
scalars_df, scalars_pandas_df = scalars_dfs
1611+
values = ["Hello, World!", 55555, 2.51, True]
1612+
bf_result = (
1613+
scalars_df[["int64_col", "float64_col", "string_col", "bool_col"]]
1614+
.isin(values)
1615+
.to_pandas()
1616+
)
1617+
pd_result = scalars_pandas_df[
1618+
["int64_col", "float64_col", "string_col", "bool_col"]
1619+
].isin(values)
1620+
1621+
pandas.testing.assert_frame_equal(bf_result, pd_result.astype("boolean"))
1622+
1623+
16091624
def test_df_isin_dict(scalars_dfs):
16101625
scalars_df, scalars_pandas_df = scalars_dfs
16111626
values = {

0 commit comments

Comments
 (0)