From 548b07a7115e9d023527c77299d10b037d81913c Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Sun, 8 Sep 2024 18:53:50 -0400 Subject: [PATCH] implement to_arrow for cuDF --- narwhals/_pandas_like/dataframe.py | 3 +-- narwhals/_pandas_like/series.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/narwhals/_pandas_like/dataframe.py b/narwhals/_pandas_like/dataframe.py index 3040adda0..75fddd18b 100644 --- a/narwhals/_pandas_like/dataframe.py +++ b/narwhals/_pandas_like/dataframe.py @@ -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() diff --git a/narwhals/_pandas_like/series.py b/narwhals/_pandas_like/series.py index e94c95a8c..b28a04088 100644 --- a/narwhals/_pandas_like/series.py +++ b/narwhals/_pandas_like/series.py @@ -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()