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

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

Open
kelli-rstudio opened this issue Nov 12, 2024 · 1 comment · May be fixed by #850
Labels
feature a feature request or enhancement

Comments

@kelli-rstudio
Copy link

Related to #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"))
@juliasilge
Copy link
Member

Hello there @kelli-rstudio! 👋 Would you like to try out a possible solution I have set up in #850? You can install with devtools::install_github("rstudio/pins-r@turn-off-table-preview-on-connect") and it works like:

library(pins)
b <- board_connect()
b  |> pin_write(kf_test, preview_data = FALSE)

@juliasilge juliasilge added the feature a feature request or enhancement label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants