You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse[1]> str(unquoted)
List of 2
$ :Formal class 'Id' [package "DBI"] with 1 slot
.. ..@ name: Named chr "dbitdrizyuhylp"
.. .. ..- attr(*, "names")= chr ""
$ :Formal class 'Id' [package "DBI"] with 1 slot
.. ..@ name: Named chr "dbitintzpndbpf"
.. .. ..- attr(*, "names")= chr ""
Browse[1]> str(unclass(objects$table[!objects$is_prefix]))
List of 2
$ :Formal class 'Id' [package "DBI"] with 1 slot
.. ..@ name: Named chr "dbitdrizyuhylp"
.. .. ..- attr(*, "names")= chr "table"
$ :Formal class 'Id' [package "DBI"] with 1 slot
.. ..@ name: Named chr "dbitintzpndbpf"
.. .. ..- attr(*, "names")= chr "table"
Note that objects is created by dbListObjects() and unquoted is created more or less as dbUnquoteIdentifier(dbQuoteIdentifier(.)). Somewhere in this quote/unquote operation (adbi relies on DBI for that), the Id names are lost. A small example for this is
x<- Id(table="test")
str(x)
#> Formal class 'Id' [package "DBI"] with 1 slot#> ..@ name: Named chr "test"#> .. ..- attr(*, "names")= chr "table"
str(DBI::dbUnquoteIdentifier(DBI::ANSI(), DBI::dbQuoteIdentifier(DBI::ANSI(), x)))
#> List of 1#> $ :Formal class 'Id' [package "DBI"] with 1 slot#> .. ..@ name: Named chr "test"#> .. .. ..- attr(*, "names")= chr ""
So I guess what I'm trying to say is that I believe it is DBI-provided functionality that causes my test failure and either the test should be relaxed (ignore name attributes) or DBI quote/unquote should preserve names.
(I believe the reproducibility issue comes from the fact, that the test is not self-contained as the DB state that is required for failure is not established as part of the test itself, but in some preceding test that I could not find.)
The text was updated successfully, but these errors were encountered:
I'm sorry, I could not make the reprex more self-contained than the following:
"list_objects_features"
(at https://github.com/r-dbi/adbi/blob/623dda0236616ed9a9cc64a878ed222479faecda/tests/testthat/test-DBItest.R#L47)The comparison that fails is
DBItest/R/spec-sql-list-objects.R
Line 131 in 86a57c3
where we have
Note that
objects
is created bydbListObjects()
andunquoted
is created more or less asdbUnquoteIdentifier(dbQuoteIdentifier(.))
. Somewhere in this quote/unquote operation (adbi relies on DBI for that), the Id names are lost. A small example for this isSo I guess what I'm trying to say is that I believe it is DBI-provided functionality that causes my test failure and either the test should be relaxed (ignore name attributes) or DBI quote/unquote should preserve names.
(I believe the reproducibility issue comes from the fact, that the test is not self-contained as the DB state that is required for failure is not established as part of the test itself, but in some preceding test that I could not find.)
The text was updated successfully, but these errors were encountered: