Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a44eafd

Browse files
authoredDec 11, 2024
fix: Fix series.isin using local path always (#1202)
1 parent d9898e6 commit a44eafd

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed
 

‎bigframes/core/blocks.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -2025,7 +2025,7 @@ def isin(self, other: Block):
20252025
assert len(other.value_columns) == 1
20262026
unique_other_values = other.expr.select_columns(
20272027
[other.value_columns[0]]
2028-
).aggregate((), by_column_ids=(other.value_columns[0],))
2028+
).aggregate((), by_column_ids=(other.value_columns[0],), dropna=False)
20292029
block = self
20302030
# for each original column, join with other
20312031
for i in range(len(self.value_columns)):
@@ -2039,9 +2039,7 @@ def _isin_inner(self: Block, col: str, unique_values: core.ArrayValue) -> Block:
20392039
expr, (l_map, r_map) = self._expr.relational_join(
20402040
unique_values, ((col, unique_values.column_ids[0]),), type="left"
20412041
)
2042-
expr, matches = expr.project_to_id(
2043-
ops.eq_op.as_expr(ex.const(True), r_map[const])
2044-
)
2042+
expr, matches = expr.project_to_id(ops.notnull_op.as_expr(r_map[const]))
20452043

20462044
new_index_cols = tuple(l_map[idx_col] for idx_col in self.index_columns)
20472045
new_value_cols = tuple(

‎bigframes/series.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ def nsmallest(self, n: int = 5, keep: str = "first") -> Series:
719719

720720
def isin(self, values) -> "Series" | None:
721721
if isinstance(values, (Series,)):
722-
self._block.isin(values._block)
722+
return Series(self._block.isin(values._block))
723723
if not _is_list_like(values):
724724
raise TypeError(
725725
"only list-like objects are allowed to be passed to "

0 commit comments

Comments
 (0)
Failed to load comments.