apache / apache/arrow

[R] Error when trying to write POSIXlt data to CSV

Open
#33,443 2 comments 0 reactions 0 assignees View on GitHub
Component: R Priority: Critical Type: bug
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 18h
Merged PRs (30d)
91

Description

I get an error trying to write a tibble of POSIXlt data to a file. The error is a bit misleading as it refers to the column being of length 0.

```r

posixlt_data <- tibble::tibble(x = as.POSIXlt(Sys.time()))
write_csv_arrow(posixlt_data, "posixlt_data.csv")
```

```r

Error: Invalid: Unsupported Type:POSIXlt of length 0
```

See also:

```r

arrow_table(posixlt_data)
```

```r

Table
2 rows x 2 columns
$x
$y
```

**Reporter**: [Nicola Crane](https://issues.apache.org/jira/browse/ARROW-18263) / @thisisnic

**Note**: *This issue was originally created as [ARROW-18263](https://issues.apache.org/jira/browse/ARROW-18263). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with the provided POSIXlt tibble using write_csv_arrow(posixlt_data, "posixlt_data.csv") and compare it with arrow_table(posixlt_data). Trace those entry points to determine why POSIXlt is reported as length 0; done means the data can be written without the misleading unsupported-type error and the regression is covered by a test.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.