rstudio / pins-r

Pin, discover, and share resources
https://pins.rstudio.com
Other
316 stars 62 forks source link

Add option to `pin_write` to exclude the data frame preview in index.html when publishing to Connect #849

Open kelli-rstudio opened 1 week ago

kelli-rstudio commented 1 week ago

Related to https://github.com/rstudio/pins-r/issues/816.

I have a data frame containing a column of nested data frames and am unable to publish it to Connect with pin_write() because it fails while generating the JSON for data frame preview in index.html (see traceback below). I am able to publish this data frame with pin_upload but it's more steps and would prefer to use pin_write. Is it possible to add an option to exclude the data frame preview when using pin_write?

> board_rsc %>%
+   pin_write(kf_test,
+             type = 'rds')
Using `name = 'kf_test'`
! Use a fully specified name including user name: "kelli.fagan/kf_test", not "kf_test".
Error in collapse(tmp, inner = FALSE, indent = indent) : 
  R character strings are limited to 2^31-1 bytes
>   traceback()
19: collapse(tmp, inner = FALSE, indent = indent)
18: .local(x, ...)
17: FUN(X[[i]], ...)
16: FUN(X[[i]], ...)
15: vapply(x, asJSON, character(1), na = na, auto_unbox = auto_unbox, 
        indent = indent + 2L, no_dots = no_dots, ...)
14: .local(x, ...)
13: asJSON(x, dataframe = dataframe, Date = Date, POSIXt = POSIXt, 
        factor = factor, complex = complex, raw = raw, matrix = matrix, 
        auto_unbox = auto_unbox, digits = digits, na = na, null = null, 
        force = force, indent = indent, ...)
12: asJSON(x, dataframe = dataframe, Date = Date, POSIXt = POSIXt, 
        factor = factor, complex = complex, raw = raw, matrix = matrix, 
        auto_unbox = auto_unbox, digits = digits, na = na, null = null, 
        force = force, indent = indent, ...)
11: jsonlite::toJSON(data_preview, auto_unbox = TRUE)
10: rsc_bundle_preview_index(board, name, x, metadata)
9: rsc_bundle_preview_create(board, name, metadata, path = bundle_path, 
       x = x)
8: rsc_bundle(board, name, paths, metadata, x = x)
7: pin_store.pins_board_connect(board, name, path, meta, versioned = versioned, 
       x = x, ...)
6: pin_store(board, name, path, meta, versioned = versioned, x = x, 
       ...)
5: pin_write(., kf_test, type = "rds")
4: board_rsc %>% pin_write(kf_test, type = "rds")
3: .is.positive.intlike(x)
2: .traceback(x, max.lines = max.lines)
1: traceback(board_rsc %>% pin_write(kf_test, type = "rds"))