Skip to content

Commit

Permalink
avoid using to/from_dask_dataframe
Browse files Browse the repository at this point in the history
  • Loading branch information
rjzamora committed Apr 24, 2024
1 parent b473fd6 commit 4243db7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions dask_sql/input_utils/dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ def to_dc(
):
if gpu: # pragma: no cover
try:
import dask_cudf
import dask_cudf # noqa: F841
except ImportError:
raise ModuleNotFoundError(
"Setting `gpu=True` for table creation requires dask_cudf"
)
if not isinstance(input_item, dask_cudf.DataFrame):
input_item = dask_cudf.from_dask_dataframe(input_item, **kwargs)
return input_item.to_backend("cudf", **kwargs)
return input_item
2 changes: 1 addition & 1 deletion tests/integration/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def gpu_datetime_table(datetime_table):

@pytest.fixture()
def gpu_timeseries(timeseries):
return dask_cudf.from_dask_dataframe(timeseries) if dask_cudf else None
return timeseries.to_backend("cudf") if dask_cudf else None


@pytest.fixture()
Expand Down

0 comments on commit 4243db7

Please sign in to comment.