Cast to data.frame to ignore other data.frame-extended classes in get_query_good_after_bad_n - #401
Cast to data.frame to ignore other data.frame-extended classes in get_query_good_after_bad_n#401MichaelChirico wants to merge 2 commits into
Conversation
|
Actually there are a number of such places, I will make the change once I get some feedback that this is likely to be accepted. Thanks! |
|
Could the "tibble return" be an option to your |
|
I think it's possible, the implication being {DBI} expects downstreams to be strictly
|
|
Again, perhaps related to tidyverse/tibble#1570 -- should tibble be more data-frame-compliant, in particular when requested? |
|
Can this be a tweak, perhaps? |
Perhaps, though the API isn't immediately obvious to me, would have to think more carefully. One reaction, though, is that in practice it would be v. similar to the current PR, just more opaque, right? -expect_equal(rows, data.frame(a = 1.5))
+expect_equal(as.data.frame(rows), data.frame(a = 1.5))vs. -expect_equal(rows, data.frame(a = 1.5))
+expect_equal(context$tweaks$standardize_return(rows), data.frame(a = 1.5))Something like that? |
|
Oh -- so From a "standards" perspective, it's easier to specify that the returned class must be a data frame and not a subclass. We could also come up with a specification of behavior that works for both data frames and tibbles. I'd really like to turn DBItest into a code generator that emits tests into the backend packages. We could make this (potentially breaking?) change as part of that exercise. |
Related: #400.
From
test_result(run_only = 'get_query_good_after_bad_n')I am getting:Another option is to weaken the expected value side:
(
check_df()just above already handles thedata.framecheck)