Skip to content

[R][Python] Expand coverage of and align R/Python to C++ CSV WriteOptions #34577

@amoeba

Description

@amoeba

Describe the enhancement requested

A user reported elsewhere that they couldn't set the delimiter in R's CsvWriteOptions$create in order to write, for example, a tab-delimited text file instead of a CSV. The signature is currently:

CsvWriteOptions$create <- function(include_header = TRUE, batch_size = 1024L, null_string = "") {}

Reference: arrow/r/R/csv.R

These arguments map to options offered in arrow/cpp/arrow/csv/options.h for WriteOptions which includes a delimiter option in addition to others:

  • bool include_header
  • int32_t batch_size
  • char delimiter
  • std::string null_string
  • std::string eol
  • QuotingStyle quoting_style

I also notice PyArrow has a different set of options in pyarrow.csv.WriteOptions than R does:

  • include_header
  • batch_size
  • delimiter
  • quoting_style

Reference: arrow/python/pyarrow/_csv.pyx

I think it would be really helpful if the full set of C++ CSV WriteOptions were available to both R and Python and that the set of options available in R and Python were identical. What do others think about aligning R and Python so all six C++ options are available to each? cc @thisisnic

Component(s)

Python, R

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions