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

Test that dbUnquoteIdentifer() return list(<Id>)? #403

Open
MichaelChirico opened this issue Mar 18, 2025 · 1 comment · May be fixed by #404
Open

Test that dbUnquoteIdentifer() return list(<Id>)? #403

MichaelChirico opened this issue Mar 18, 2025 · 1 comment · May be fixed by #404

Comments

@MichaelChirico
Copy link
Contributor

simple_out <- dbUnquoteIdentifier(con, simple_in)

We had a mistake where dbUnquoteIdentifier(con, <SQL>) returned list(<char>) instead of list(<Id>), as documented in ?dbUnquoteIdentifier:

https://dbi.r-dbi.org/reference/dbUnquoteIdentifier.html

This caused a more obscure/hard-to-debug error a bit later in the test:

expect_identical(dbUnquoteIdentifier(con, simple_out[[1]]), simple_out)

which expects to be doing dbUnquoteIdentifier(con, <Id>) but was actually doing dbUnquoteIdentifier(con, <char>).

It looks to me like we could make the failure more informative by checking that dbUnquoteIdentifier() returned list(<Id>) up front, does that make sense?

@krlmlr
Copy link
Member

krlmlr commented Mar 18, 2025

Test failures should be as obvious as possible, so, yes, this sounds right.

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.

2 participants