Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Fix gpu cudf to_csv #799

Merged
merged 14 commits into from
Aug 21, 2024
15 changes: 14 additions & 1 deletion python/xorbits/_mars/dataframe/datastore/to_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from ...tensor.core import TensorOrder
from ...tensor.operands import TensorOperand, TensorOperandMixin
from ..operands import DataFrameOperand, DataFrameOperandMixin
from ..utils import is_pandas_2, parse_index
from ..utils import is_cudf, is_pandas_2, parse_index


class DataFrameToCSV(DataFrameOperand, DataFrameOperandMixin):
Expand Down Expand Up @@ -374,6 +374,19 @@ def _to_csv(cls, op, df, path, header=None):
kwargs["line_terminator"] = op.lineterminator
kwargs.pop("lineterminator")

# fix issue #795: https://github.com/xorbitsai/xorbits/issues/795
luweizheng marked this conversation as resolved.
Show resolved Hide resolved
if is_cudf(df):
kwargs.pop("float_format")
kwargs.pop("index_label")
kwargs.pop("mode")
kwargs.pop("quoting")
kwargs.pop("quotechar")
kwargs.pop("date_format")
kwargs.pop("doublequote")
kwargs.pop("escapechar")
kwargs.pop("decimal")
kwargs["compression"] = None

df.to_csv(path, **kwargs)

@classmethod
Expand Down
Loading