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

Unable to connect to bigqueyr table in dev version #1326

Closed
oobd opened this issue Jul 5, 2023 · 10 comments
Closed

Unable to connect to bigqueyr table in dev version #1326

oobd opened this issue Jul 5, 2023 · 10 comments

Comments

@oobd
Copy link

oobd commented Jul 5, 2023

Hi, not sure if the issue is caused by #1287 or something else but I am unable to connect to bigquery tables using the latest dev version of the package.

library(dplyr)
library(dbplyr)
library(DBI)

conn = DBI::dbConnect(
    bigrquery::bigquery(),
    project = 'bigquery-public-data',
    dataset = "covid19_public_forecasts",
    KeyFilePath = "covid19_public_forecasts",
    OAuthMechanism = 0
)
dbListTables(conn)

state_14d <- tbl(conn, 'state_14d')

Using a public bigquery dataset, I get the following error when running the tbl command.
Error in strsplit(name, ".", fixed = TRUE) : non-character argument

Package versions are:
dbplyr: 2.3.2.9000
dplyr: 1.1.2
DBI: 1.1.3

@rbcavanaugh
Copy link

I've been seeing this error too using the AlloUs Research program's workbench. The error only seems to occur when no other SQL is added to the query at least in this case. I"ve tried with CRAN and dev versions of dplyr/dbplyr. Thanks!

For example, this would not work:

tbl(con, "mtcars")

This works:

tbl(con, "mtcars") |> select(cyl)

Here's the error from our actual db:

Error in strsplit(name, ".", fixed = TRUE): non-character argument
Traceback:

1. tbl(con, "observation")
2. tbl.DBIConnection(con, "observation")
3. tbl(dbplyr::src_dbi(src, auto_disconnect = FALSE), from = from, 
 .     ...)
4. tbl.src_dbi(dbplyr::src_dbi(src, auto_disconnect = FALSE), from = from, 
 .     ...)
5. tbl_sql(c(subclass, "dbi"), src = src, from = from, ...)
6. vars %||% dbplyr_query_fields(src$con, from)
7. dbplyr_query_fields(src$con, from)
8. dbplyr_fallback(con, "db_query_fields", ...)
9. eval_bare(expr((!!fun)(con, ...)))
10. dplyr::db_query_fields(con, ...)
11. db_query_fields.BigQueryConnection(con, ...)
12. as_bq_table(con, sql)
13. as_bq_table.BigQueryConnection(con, sql)
14. strsplit(name, ".", fixed = TRUE)
15. ```

@hadley
Copy link
Member

hadley commented Nov 2, 2023

Looks like it was reported in r-dbi/bigrquery#509 and fixed in r-dbi/bigrquery#512

@hadley hadley closed this as completed Nov 2, 2023
@paulcbauer
Copy link

Apologies.. what is the status of this/final solution?

I am using bigrquery_1.4.2 dbplyr_2.4.0 dplyr_1.1.3 and getting the error Fehler in strsplit(name, ".", fixed = TRUE) : nicht-character Argument when running dplyr::tbl(bq_conn, '...') . Not sure what previous package versions I should resort to.

@hadley
Copy link
Member

hadley commented Nov 3, 2023

Yes, that actually appears to be a different problem, despite the similar error. I am working on bigrquery for a bit and will hopefully have a fix soon.

@paulcbauer
Copy link

That would be great. Thank you.

@hadley
Copy link
Member

hadley commented Nov 7, 2023

@paulcbauer it's fixed

@paulcbauer
Copy link

It works. Thank you!

@dzion
Copy link

dzion commented Nov 13, 2023

This is not yet fixed in the version(s) of the packages on CRAN, correct @hadley? I am seeing the same issue as @paulcbauer.

Apologies.. what is the status of this/final solution?

I am using bigrquery_1.4.2 dbplyr_2.4.0 dplyr_1.1.3 and getting the error Fehler in strsplit(name, ".", fixed = TRUE) : nicht-character Argument when running dplyr::tbl(bq_conn, '...') . Not sure what previous package versions I should resort to.

@paulcbauer
Copy link

Not on CRAN yet I think but you can install the development versions which worked for me:

install.packages("pak")
pak::pak("r-dbi/bigrquery")
pak::pak("tidyverse/dbplyr")

@dzion
Copy link

dzion commented Nov 13, 2023

Thanks. That works for me as well. However, I need it in a production app, where I don't want to use development versions of packages. Alas, I will (need to) wait.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants