Skip to content

Commit

Permalink
fill_null include type
Browse files Browse the repository at this point in the history
  • Loading branch information
FBruzzesi committed Jul 19, 2024
1 parent d863827 commit 8dd7815
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion narwhals/_arrow/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,12 @@ def sample(
return self._from_native_series(pc.take(ser, mask))

def fill_null(self: Self, value: Any) -> Self:
pa = get_pyarrow()
pc = get_pyarrow_compute()
return self._from_native_series(pc.fill_null(self._native_series, value))
ser = self._native_series
dtype = ser.type

return self._from_native_series(pc.fill_null(ser, pa.scalar(value, dtype)))

@property
def shape(self) -> tuple[int]:
Expand Down

0 comments on commit 8dd7815

Please sign in to comment.