Skip to content

write_*()⁠ family doesn't error when writing list column #1572

@heliconone

Description

@heliconone

The write_*() family of functions currently do not error when the data contains a list column (#938). Trying to write a matrix column however does still give the expected error.

library(tibble)
library(readr) # readr 2.15 & 2.1.5.9000

# List column doesn't error - file is written with an empty column 
tibble(id = 1:3, 
       x = lapply(1:3, seq)) |> 
  write_csv("file1.csv")

# Matrix column errors as expected
tibble(id = 1:3, 
       x = matrix(1:3, 3)) |> 
  write_csv("file1.csv")
#> Error in `cli_block()`:
#> ! `x` must not contain list or matrix columns:
#> ✖ invalid columns at index(s): 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions