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
For the implementation in adbi, this means that setting bigint = "integer64" will always return integer64, irrespective of whether the data fits into the int range or not. This deviates from how RSQLite interprets this option.
This causes issues in DBItest that might require a "tweak" similar to how logical_return works, as I now get a failure for example in table_visible_in_other_connection :
ctx<-DBItest::make_context(
adbi::adbi("adbcsqlite"),
list(
uri= tempfile("DBItest", fileext=".sqlite"),
rows_affected_callback=function() function(x) {
if (x==-1) testthat::skip("unknown number of `rows_affected`") elsex
}
),
tweaks= suppressWarnings(
DBItest::tweaks(
dbitest_version="1.7.3",
constructor_relax_args=TRUE,
placeholder_pattern= c("?", "$1", "$name", ":name"),
date_cast=function(x) paste0("'", x, "'"),
time_cast=function(x) paste0("'", x, "'"),
timestamp_cast=function(x) paste0("'", x, "'"),
logical_return=function(x) bit64::as.integer64(x),
date_typed=FALSE,
time_typed=FALSE,
timestamp_typed=FALSE,
temporary_tables=FALSE, # apache/arrow-adbc#1141strict_identifier=TRUE
)
),
name="adbi"
)
trace(DBItest:::expect_equal_df, quote({print(str(actual)); print(str(expected))}))
#> Tracing function "expect_equal_df" in package "DBItest#> (not-exported)"#> [1] "expect_equal_df"
try(DBItest::test_some("table_visible_in_other_connection", ctx, FALSE))
#> Tracing expect_equal_df(penguins_out, penguins30) on entry#> 'data.frame': 3 obs. of 8 variables:#> $ species : chr "Adelie" "Gentoo" "Chinstrap"#> $ island : chr "Torgersen" "Biscoe" "Dream"#> $ bill_length_mm : num 39.1 46.1 46.5#> $ bill_depth_mm : num 18.7 13.2 17.9#> $ flipper_length_mm:integer64 181 211 192#> $ body_mass_g :integer64 3750 4500 3500#> $ sex : chr "male" "female" "female"#> $ year :integer64 2007 2007 2007#> NULL#> 'data.frame': 3 obs. of 8 variables:#> $ species : chr "Adelie" "Gentoo" "Chinstrap"#> $ island : chr "Torgersen" "Biscoe" "Dream"#> $ bill_length_mm : num 39.1 46.1 46.5#> $ bill_depth_mm : num 18.7 13.2 17.9#> $ flipper_length_mm: int 181 211 192#> $ body_mass_g : int 3750 4500 3500#> $ sex : chr "male" "female" "female"#> $ year : int 2007 2007 2007#> NULL#> Tracing expect_equal_df(dbReadTable(con2, table_name), penguins30) on entry#> 'data.frame': 3 obs. of 8 variables:#> $ species : chr "Adelie" "Gentoo" "Chinstrap"#> $ island : chr "Torgersen" "Biscoe" "Dream"#> $ bill_length_mm : num 39.1 46.1 46.5#> $ bill_depth_mm : num 18.7 13.2 17.9#> $ flipper_length_mm:integer64 181 211 192#> $ body_mass_g :integer64 3750 4500 3500#> $ sex : chr "male" "female" "female"#> $ year :integer64 2007 2007 2007#> NULL#> 'data.frame': 3 obs. of 8 variables:#> $ species : chr "Adelie" "Gentoo" "Chinstrap"#> $ island : chr "Torgersen" "Biscoe" "Dream"#> $ bill_length_mm : num 39.1 46.1 46.5#> $ bill_depth_mm : num 18.7 13.2 17.9#> $ flipper_length_mm: int 181 211 192#> $ body_mass_g : int 3750 4500 3500#> $ sex : chr "male" "female" "female"#> $ year : int 2007 2007 2007#> NULL
Note the different types for columns flipper_length_mm and body_mass_g between actual and expected in the two calls to expect_equal_df().
Some info on package versions (happy to provide more if needed):
The text was updated successfully, but these errors were encountered:
krlmlr
changed the title
Deal with bigint = "integer64" to mean "always return integer64
Deal with bigint = "integer64" to mean "always return integer64"
Dec 16, 2023
As per spec, the semantics for the
bigint = "integer64"
connection argument areFor the implementation in adbi, this means that setting
bigint = "integer64"
will always returninteger64
, irrespective of whether the data fits into the int range or not. This deviates from how RSQLite interprets this option.This causes issues in DBItest that might require a "tweak" similar to how
logical_return
works, as I now get a failure for example intable_visible_in_other_connection
:Note the different types for columns
flipper_length_mm
andbody_mass_g
betweenactual
andexpected
in the two calls toexpect_equal_df()
.Some info on package versions (happy to provide more if needed):
The text was updated successfully, but these errors were encountered: