Skip to content

Commit

Permalink
implement to_arrow for cuDF
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamConnors committed Sep 8, 2024
1 parent 58c1b23 commit 548b07a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions narwhals/_pandas_like/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,7 @@ def gather_every(self: Self, n: int, offset: int = 0) -> Self:

def to_arrow(self: Self) -> Any:
if self._implementation is Implementation.CUDF: # pragma: no cover
msg = "`to_arrow` is not implemented for CuDF backend."
raise NotImplementedError(msg)
return self._native_frame.to_arrow(preserve_index=False)

import pyarrow as pa # ignore-banned-import()

Expand Down
3 changes: 1 addition & 2 deletions narwhals/_pandas_like/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,7 @@ def clip(

def to_arrow(self: Self) -> Any:
if self._implementation is Implementation.CUDF: # pragma: no cover
msg = "`to_arrow` is not implemented for CuDF backend."
raise NotImplementedError(msg)
return self._native_series.to_arrow()

import pyarrow as pa # ignore-banned-import()

Expand Down

0 comments on commit 548b07a

Please sign in to comment.