Skip to content

[R] Expose ignore_extra_columns and pad_short_rows CSV parse options #51659

Description

@thisisnic

Describe the enhancement requested

Arrow C++ 26.0.0 adds two new arrow::csv::ParseOptions fields:

Neither can be set from R. csv_parse_options() and CsvParseOptions$create() should accept both, and csv.cpp should pass them through:

arrow/r/R/csv.R

Lines 735 to 753 in 9479e68

quote_char = '"',
double_quote = TRUE,
escaping = FALSE,
escape_char = "\\",
newlines_in_values = FALSE,
ignore_empty_lines = TRUE
) {
csv___ParseOptions__initialize(
list(
delimiter = delimiter,
quoting = quoting,
quote_char = quote_char,
double_quote = double_quote,
escaping = escaping,
escape_char = escape_char,
newlines_in_values = newlines_in_values,
ignore_empty_lines = ignore_empty_lines
)
)

arrow/r/src/csv.cpp

Lines 64 to 72 in 9479e68

res->delimiter = cpp11::as_cpp<char>(options["delimiter"]);
res->quoting = cpp11::as_cpp<bool>(options["quoting"]);
res->quote_char = cpp11::as_cpp<char>(options["quote_char"]);
res->double_quote = cpp11::as_cpp<bool>(options["double_quote"]);
res->escape_char = cpp11::as_cpp<char>(options["escape_char"]);
res->newlines_in_values = cpp11::as_cpp<bool>(options["newlines_in_values"]);
res->ignore_empty_lines = cpp11::as_cpp<bool>(options["ignore_empty_lines"]);
return res;
}

Component(s)

R

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions