Skip to content

Commit

Permalink
Register read_parquet and read_csv as "dispatchable" (#1114)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjzamora authored Aug 12, 2024
1 parent 0bb77f1 commit 39d09eb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dask_expr/_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import numpy as np
import pandas as pd
import pyarrow as pa
from dask import compute, config, get_annotations
from dask import compute, get_annotations
from dask.array import Array
from dask.base import DaskMethodsMixin, is_dask_collection, named_schedulers
from dask.core import flatten
Expand Down Expand Up @@ -5099,6 +5099,7 @@ def from_dask_array(x, columns=None, index=None, meta=None):
return from_legacy_dataframe(df, optimize=True)


@dataframe_creation_dispatch.register_inplace("pandas")
def read_csv(
path,
*args,
Expand All @@ -5109,7 +5110,6 @@ def read_csv(
):
from dask_expr.io.csv import ReadCSV

dataframe_backend = config.get("dataframe.backend", "pandas")
if not isinstance(path, str):
path = stringify_path(path)
return new_collection(
Expand All @@ -5119,7 +5119,7 @@ def read_csv(
storage_options=storage_options,
kwargs=kwargs,
header=header,
dataframe_backend=dataframe_backend,
dataframe_backend="pandas",
)
)

Expand Down Expand Up @@ -5174,6 +5174,7 @@ def read_fwf(
)


@dataframe_creation_dispatch.register_inplace("pandas")
def read_parquet(
path=None,
columns=None,
Expand Down

0 comments on commit 39d09eb

Please sign in to comment.