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

Error in strsplit() on "head-only" queries #509

Closed
calebwpalmer opened this issue Sep 23, 2022 · 2 comments · Fixed by #512
Closed

Error in strsplit() on "head-only" queries #509

calebwpalmer opened this issue Sep 23, 2022 · 2 comments · Fixed by #512

Comments

@calebwpalmer
Copy link

When running a "head-only" query, the following error is returned

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

Drilling down, the error occurs in dbplyr.R line 113:

name <- op_table(x, con)

op_table() eventually arrives at op_table.lazy_select_query(), which returns a list instead of a character string.
op_table.lazy_select_query <- function(x, con) {
returns a list instead of the name.

This error does not occur when explicitly calling collect()

if (bq_testable()) {
  ds <- bq_test_dataset(name = "bigrquery_test")

  bq_mtcars <- bq_table(ds, "mtcars")
  bq_table_exists(bq_mtcars)
  
  bq_table_upload(bq_mtcars, mtcars)
  
  library(dplyr)
  con <- bigrquery::dbConnect(bigrquery::bigquery(),
                              bigint = "character",
                              project = Sys.getenv("BIGQUERY_TEST_PROJECT"))
  
  test <- tbl(con, "bigrquery_test.mtcars")
  
  # strsplit error
  test

  # no strsplit error
  collect(test)
  
  }
clente added a commit to clente/bigrquery that referenced this issue Oct 10, 2022
@thomasjohnflaherty
Copy link

Any updates here? This also affects functions like glimpse().

ghstreamline pushed a commit to StreamlineDataScience/bigrquery that referenced this issue Mar 8, 2023
@issactoast
Copy link

I still have the same error when I try to print head of the db table or glimpse(). Other codes work fine, tho.

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

ord_prd_data |> glimpse()
Rows: ??
Error in strsplit(name, ".", fixed = TRUE) : non-character argument

Version info
dbplyr 2.3.2.9.000
bigrquery 1.4.1
R 4.2.2

jennybc added a commit that referenced this issue Apr 17, 2023
…512)

* Fix #509

* Use op_table()

Co-authored-by: Maximilian Girlich <[email protected]>

* Fix indentation

* Add bullet describing op_table.lazy_select_query()'s new return

* Add test for 'can correclty print a lazy query'

* Typo correclty -> correctly

* Revert whitespace trimming

* Expand NEWS bullet a bit

---------

Co-authored-by: Maximilian Girlich <[email protected]>
Co-authored-by: Jenny Bryan <[email protected]>
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

Successfully merging a pull request may close this issue.

3 participants