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

compatibility with box::use #57

Open
tyner opened this issue Oct 20, 2023 · 1 comment
Open

compatibility with box::use #57

tyner opened this issue Oct 20, 2023 · 1 comment

Comments

@tyner
Copy link

tyner commented Oct 20, 2023

I am not entirely sure whether this is an issue with box versus implyr, but thought I might start here given the similarity with issue #9. I am using implyr version 0.4.0, odbc version 1.3.4, DBI version 1.1.3, and R version 4.1.3 on Windows 10 x64.

Example to demonstrate:

box::use(implyr[src_impala], DBI[dbGetQuery])
options(warn=1)
impala <- src_impala(drv = odbc::odbc(),
                     dsn = "my_dsn",
                     database = "default",
                     bigint = "character",
                     auto_disconnect = FALSE
                     )
                        
ret <- dbGetQuery(impala, "show databases") 

the error is:

Error in setMethod("dbSendQuery", c("impala_connection", "character"),  : 
  no existing definition for function ‘dbSendQuery’

Apologies if I'm barking up the wrong tree on this one.

@tyner
Copy link
Author

tyner commented Oct 20, 2023

FWIW, if I do it this way, it works:

box::use(implyr[src_impala, dbGetQuery],
         DBI[dbSendQuery, dbExecute])

but not if I wrap that block inside a local; i.e., this still fails:

local({
box::use(implyr[src_impala, dbGetQuery],
         DBI[dbSendQuery, dbExecute])
options(warn=1)
impala <- src_impala(drv = odbc::odbc(),
                     dsn = "my_dsn",
                     database = "default",
                     bigint = "character",
                     auto_disconnect = FALSE
                     )
                        
ret <- dbGetQuery(impala, "show databases")                        
})

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

1 participant