Skip to content

Commit

Permalink
feat: implement to_arrow for cuDF (#924)
Browse files Browse the repository at this point in the history
* xfail to_arrow tests for cuDF

* Revert "xfail to_arrow tests for cuDF"

This reverts commit d695efd.

* implement to_arrow for cuDF
  • Loading branch information
LiamConnors authored Sep 9, 2024
1 parent 693d53a commit 7bfb776
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 @@ -672,8 +672,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 7bfb776

Please sign in to comment.