posit-dev / positron

Positron, a next-generation data science IDE
Other
2.45k stars 73 forks source link

tibble::view() error, variable name limitation #4702

Open benhmin opened 6 days ago

benhmin commented 6 days ago

System details:

Positron and OS details:

Mac OS 14.6.1, ARM/M2 Positron Version: 2024.09.0 (Universal) build 27 Code - OSS Version: 1.92.0 Commit: d996153f3be6bcc9af460300e61103425323b973 Date: 2024-09-11T02:38:46.408Z Electron: 30.1.2 Chromium: 124.0.6367.243 Node.js: 20.14.0 V8: 12.4.254.20-electron.0 OS: Darwin arm64 23.6.0

Interpreter details: R 4.4.1

Describe the issue:

In Positron it seems that the tibble::view() command does not work for any df above a certain size. The error returned is: Error inexists(): ! variable names are limited to 10000 bytes

The length of variable names does not seem to impact the occurrence of the error, rather the size/length of the data frame?

Steps to reproduce the issue:

  1. This code works: head(palmerpenguins::penguins, 50) |> tibble::view()
  2. This code works: palmerpenguins::penguins |> utils::View()
  3. This code doesn't (error as above): palmerpenguins::penguins |> tibble::view()

Expected or desired behavior:

would expect the tibble::view() command to appropriately pass objects to either utils::View() or as.data.frame() . . . as described here: https://tibble.tidyverse.org/reference/view.html

Maybe this is an issue with tibble more than with positron, but this problem does not occur in RStudio 2024.04.2+764 on the same machine. This is a very commonly used package (tidyverse) and the view() command typically is used rather than the utils::View() function once the tidyverse is loaded.

petetronic commented 5 days ago

Thank you @benhmin for testing Positron! I'm able to reproduce this issue, sending to Triage.

juliasilge commented 4 days ago

Here is the full traceback:

Error in `exists()`:
! variable names are limited to 10000 bytes
Hide Traceback
    ▆
 1. ├─tibble::view(palmerpenguins::penguins)
 2. │ └─rlang::eval_tidy(quo(view_fun(!!x, !!title)))
 3. └─view_fun(`<tibble[,8]>`, "palmerpenguins::penguins")
 4.   ├─base::isTRUE(exists(object_name, envir = parent.frame(), inherits = FALSE))
 5.   └─base::exists(object_name, envir = parent.frame(), inherits = FALSE)

And here is what tibble is doing:

eval_tidy(quo(view_fun(!!x, !!title)))
DavisVaughan commented 4 days ago

Oh gosh its inlining the whole data frame 😭 cc @lionel-

We should probably do a tibble PR