daft.DataFrame.write_csv

daft.DataFrame.write_csv#

DataFrame.write_csv(root_dir: Union[str, Path], write_mode: Literal['append', 'overwrite'] = 'append', partition_cols: Optional[List[Union[Expression, str]]] = None, io_config: Optional[IOConfig] = None) DataFrame[source]#

Writes the DataFrame as CSV files, returning a new DataFrame with paths to the files that were written

Files will be written to <root_dir>/* with randomly generated UUIDs as the file names.

Note

This call is blocking and will execute the DataFrame when called

Parameters:
  • root_dir (str) – root file path to write parquet files to.

  • write_mode (str, optional) – Operation mode of the write. append will add new data, overwrite will replace table with new data. Defaults to “append”.

  • partition_cols (Optional[List[ColumnInputType]], optional) – How to subpartition each partition further. Defaults to None.

  • io_config (Optional[IOConfig], optional) – configurations to use when interacting with remote storage.

Returns:

The filenames that were written out as strings.

Return type:

DataFrame