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

Data preview fails for data.frames that are part of another object #13291

Closed
4 tasks done
jonvanausdeln opened this issue Jun 26, 2023 · 2 comments
Closed
4 tasks done
Assignees
Labels
autocompletion Issues relating to autocomplete and autocompletion bug

Comments

@jonvanausdeln
Copy link

jonvanausdeln commented Jun 26, 2023

System details

RStudio Edition : Desktop (all)
RStudio Version : 2023.06.1-438
OS Version      : All
R Version       : All

Steps to reproduce the problem

From #13188 (comment)

test_df <- data.frame(col1 = rep(1, 3),
                      col2 = rep(2, 3),
                      col3 = rep(3, 3))

test_ls <- list(a = test_df,
                b = test_df)

Describe the problem in detail

test_ls$ + tab , won't show the dataframe preview

Describe the behavior you expected

preview of data should show as part of autocomplete

  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
@jonvanausdeln jonvanausdeln added bug new New incoming issues, ready for initial review. triage and removed new New incoming issues, ready for initial review. labels Jun 26, 2023
@sharon-wang
Copy link
Member

Looking into why we are unable to find the object (and thus can't load the data frame preview)...

Note the differences between the grid_data request payload:

image

In particular, env and cache_key look pretty different from CB to the MH releases. I think we're having trouble locating test_ls$a because of these values changing.

2023.6.1 - response error

{"error":"The object no longer exists."}

2023.06.0 - response error

{"error":"r error 4 (Error in if (maxRows != -1 && nrow(data) > maxRows) data <- head(data,  : \n  missing value where TRUE/FALSE needed\n)"}

2023.03.0 - data retrieved successfully


Paraphrased from @kevinushey:

Note that the cache key was removed in 2023.6.0 because we don't have a good way to "invalidate" the cached object (the object sticks around for the rest of the session).

When using cache keys, the object sticking around can result in a "stale" object being shown in the help data preview popup, so the preview might be for a different object than the one the user is actually trying to preview.


So we'll want to avoid re-introducing the cacheKey in the fix, or at least avoid the mismatched object preview issue.

@ronblum ronblum added this to the Desert Sunflower milestone Jul 5, 2023
@ronblum ronblum added autocompletion Issues relating to autocomplete and autocompletion and removed triage labels Jul 5, 2023
@sharon-wang sharon-wang self-assigned this Jul 5, 2023
@jonvanausdeln jonvanausdeln self-assigned this Jul 13, 2023
@jonvanausdeln
Copy link
Author

Verified on Desktop 2023.09.0-daily+217

Autocomplete works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autocompletion Issues relating to autocomplete and autocompletion bug
Projects
None yet
Development

No branches or pull requests

3 participants