Skip to content

Commit ddd1798

Browse files
committed
fix: update fillna behavior in series.py to process null values
1 parent 638f083 commit ddd1798

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/bigframes/bigframes/series.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,10 +1146,12 @@ def nsmallest(self, n: int = 5, keep: str = "first") -> Series:
11461146
)
11471147

11481148
def isin(self, values) -> "Series":
1149+
# Block.isin can return nulls for non-matching rows, but pandas.isin
1150+
# always returns boolean (False for non-matches). We fill nulls with False.
11491151
if isinstance(values, Series):
1150-
return Series(self._block.isin(values._block))
1152+
return Series(self._block.isin(values._block)).fillna(value=False)
11511153
if isinstance(values, indexes.Index):
1152-
return Series(self._block.isin(values.to_series()._block))
1154+
return Series(self._block.isin(values.to_series()._block)).fillna(value=False)
11531155
if not _is_list_like(values):
11541156
raise TypeError(
11551157
"only list-like objects are allowed to be passed to "

0 commit comments

Comments
 (0)