Closed shearerpmm closed 2 weeks ago
In case it helps, here is the diff between dbplyr 2.3.4 and 2.4.0: https://github.com/tidyverse/dbplyr/compare/v2.3.4...v2.4.0
It looks like using $
to access a column from one of these tables previously returned NULL
, but now instead signals an error. Compare:
> test$mpg
NULL
and
> test$mpg
Error in `test$mpg`:
! The `$` method of <tbl_lazy> is for internal use only.
ℹ Use `dplyr::pull()` to get the values in a column.
Run `rlang::last_trace()` to see where the error occurred.
Unfortunately, RStudio tries to iterate over each column and return the column value + type when producing completions, leading to this issue. I'm guessing we'll need to change RStudio to accommodate these changes.
Thank you so much! Since I only use this feature to discover column names on a table, and pressing enter normally just returns NULL, I did not think to actually press enter here.
Some context: my use of $-tab completion is actually a workaround for semi-broken tab-completion within select()
contexts while using dbplyr + Vertica. But I haven't created tickets for that because I have yet to figure out how to make it reproducible.
I'll close this for now since it looks like you have the fix within RStudio.
Tab-autocomplete of table column names is slower when using dbplyr 2.4.0+ than 2.3.4. The code below reproduces the issue on my machine, which is on RStudio Version 2023.12.1+402 (2023.12.1+402).
sessionInfo()
at bottom.Autocomplete using $ is instantaneous on 2.3.4 but takes 1-2 seconds on 2.4.0. It seems unaffected in the dplyr::select environment.
While the delay in autocomplete here is only a couple seconds, I am finding that it is much worse with lazy tbls based on a JDBC connection (to my organization's Vertica database). In that case I see delays of 5-10 seconds, and they affect both $ and dplyr::select autocomplete. But it would be harder/maybe-impossible for me to provide a reprex of this, so I'm hoping that this one will suffice to diagnose the issue.
The issue also affects the current CRAN version 2.5.0.
sessionInfo