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

Unexpected behavior from get_tbl_information_dbi when tbl name created with dbplyr::in_schema #468

Open
brancengregory opened this issue Apr 12, 2023 · 1 comment
Milestone

Comments

@brancengregory
Copy link
Contributor

brancengregory commented Apr 12, 2023

The code found here produces behavior which will cause failure, including of core functions like create_agent

If the tbl supplied to create_agent is created with dbplyr::in_schema like so:

con <- DBI::dbConnect(RPostgres::Postgres())
test_tbl <- tbl(con, dbplyr::in_schema(schema = "public", table = "<table_name>"))

Then, get_tbl_information_dbi will convert the table name into a length two character vector. Then when the q_types query is created it will also be a length two character vector. When the query is sent to the db, it fails.

@rich-iannone, I would love any guidance on how to create a reprex for these types of issues. I have needed to create them for other bugs I've found in R packages, but haven't been able to figure out how to mock the db connection.

Anyways, I'm happy to take a swing at fixing this. I'm thinking we could check the class of dbplyr::remote_name(tbl) and change behavior accordingly. Thoughts or alternatives?

@brancengregory
Copy link
Contributor Author

PS. I created this issue like in the screenshot which bypassed the issue template unintended by me
image

brancengregory added a commit to brancengregory/pointblank that referenced this issue Apr 12, 2023
@rich-iannone rich-iannone added this to the FUTURE milestone Feb 20, 2024
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

2 participants