Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More helpful error when trying to write out data frames with list columns #938

Closed
jimjam-slam opened this issue Dec 6, 2018 · 2 comments · Fixed by #1009
Closed

More helpful error when trying to write out data frames with list columns #938

jimjam-slam opened this issue Dec 6, 2018 · 2 comments · Fixed by #1009
Labels
feature a feature request or enhancement tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day

Comments

@jimjam-slam
Copy link

jimjam-slam commented Dec 6, 2018

library(tidyverse)
#> Warning: package 'ggplot2' was built under R version 3.5.1
#> Warning: package 'dplyr' was built under R version 3.5.1
diamonds %>% nest(-cut) %>% write_csv('test.csv')
#> Error in stream_delim_(df, path, ...): Don't know how to handle vector of type list.

Created on 2018-12-06 by the reprex package (v0.2.0).

It would be more useful (especially in non-interactive use) if the write_ functions reported which column it was unable to handle. My feeling is this error either happens because:

  • Someone forgot to drop an intermediate list column (eg. nested source data or a list of models) before exporting;
  • They accidentally used regular map() instead of a type-coercive variety like map_dbl to extract a parameter; or
  • They don't understand that flat files can't store more complex list columns.

I understand that there's some discussion in #303 about potentially handling simple list columns, but given the variety of objects that end up in list columns accidentally, I imagine this problem will still exist even if that issue gets resolved. Actually implementing a PR for this might be a little out of my depth, but I'm willing to give it a go over Xmas.

@jimhester jimhester added the feature a feature request or enhancement label Dec 20, 2018
@lambdamoses
Copy link
Contributor

lambdamoses commented Jan 19, 2019

I'm working on this

@lock
Copy link

lock bot commented Jan 4, 2020

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Jan 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature a feature request or enhancement tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants