-
Notifications
You must be signed in to change notification settings - Fork 32
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
Error in UseMethod("sql_query_fields") : no applicable method for 'sql_query_fields' applied to an object of class "c('Pool', 'R6')" #180
Comments
Can you please provide a minimal reprex (reproducible example)? The goal of a reprex is to make it as easy as possible for me to recreate your problem so that I can fix it: please help me help you! If you've never heard of a reprex before, start by reading about the reprex package, including the advice further down the page. Please make sure your reprex is created with the reprex package as it gives nicely formatted output and avoids a number of common pitfalls. |
Sorry, should have known better... library(RSQLite)
library(pool)
library(dplyr)
#>
#> Attache Paket: 'dplyr'
#> Die folgenden Objekte sind maskiert von 'package:stats':
#>
#> filter, lag
#> Die folgenden Objekte sind maskiert von 'package:base':
#>
#> intersect, setdiff, setequal, union
pool <- dbPool(RSQLite::SQLite())
dbWriteTable(pool, "mtcars", mtcars)
tbl(pool, "mtcars")
#> Error in get(x, envir = ns, inherits = FALSE) :
#> Objekt 'db_col_types' nicht gefunden
#> Error in UseMethod("sql_query_fields"): nicht anwendbare Methode für 'sql_query_fields' auf Objekt der Klasse "c('Pool', 'R6')" angewendet Created on 2024-02-13 with reprex v2.1.0 |
I think you mistyped mydb instead of pool in that example. |
@hadley Jep, corrected it. In my actual code I the driver odbc::odbc(), but the problem or error is the same. Not sure if its an issue resulting from |
Can you please try updating dbplyr to see if that makes the problem go away? |
Due to my companies policy I have no build tools available and the binary available of e.g. rlang (dependency of dbplyr) is 1.1.0 :/ |
Can you use a custom repository? It looks like Posit package manager has binaries for R 4.1: options(repos = c(CRAN = "https://packagemanager.posit.co/cran/latest")) |
I will see what I can do. I just tried at my desktop at home and the problem is gone with following session params. I guess this can be closed and - worst case - I have to fight my IT...
|
Looks like I need to bump the required version of dbplyr. I'll do a new release shortly, which might help resolve your problems. (Otherwise you should see if your IT will let you use posit public package manager as it will allow you to keep using old R with latest packages) |
It looks like |
Up until now, I had no problem running this statement:
df <- tbl(src = pool, DBI::Id(schema = "dwh", table = "v_myview"))
I expected to find a lazy table in df. Now I get an error:
tbl(src = pool, DBI::Id(schema = "dwh", table = "v_ASA_population_overview"))
Running
dbGetQuery(pool, SELECT * FROM dwh.v_myview")
on the other hand works fine.The text was updated successfully, but these errors were encountered: