apache / apache/arrow

[R] Map `format = "text` to `format = "csv"` in `write_dataset()`

Open
#38,217 1 comment 0 reactions 1 assignee Claimed by @thisisnic View on GitHub
Component: R good-first-issue Type: enhancement
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

### Describe the enhancement requested

In `write_dataset()`, we should map "text" to "csv" like we do with `open_dataset()`

``` r
library(arrow)
library(dplyr)

tf <- tempfile()
dir.create(tf)
# gives an error
write_dataset(mtcars, tf, format = "text")
#> Error in write_dataset(mtcars, tf, format = "text"): A delimiter must be given for a txt format.

write_dataset(mtcars, tf, format = "csv")

# this works
open_dataset(tf, format = "text")
#> FileSystemDataset with 1 csv file
#> mpg: double
#> cyl: int64
#> disp: double
#> hp: int64
#> drat: double
#> wt: double
#> qsec: double
#> vs: int64
#> am: int64
#> gear: int64
#> carb: int64
```

Created on 2023-10-11 with [reprex v2.0.2](https://reprex.tidyverse.org)

### Component(s)

R

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.