From 55f78ba23516cedfe188dcb5ed576567382d9342 Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Fri, 22 Dec 2023 12:50:14 -0400 Subject: [PATCH 1/8] add dbi test to CI --- r/adbcsqlite/DESCRIPTION | 1 + r/adbcsqlite/tests/testthat/test-DBItest.R | 94 ++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 r/adbcsqlite/tests/testthat/test-DBItest.R diff --git a/r/adbcsqlite/DESCRIPTION b/r/adbcsqlite/DESCRIPTION index 27b957b599..cb2d1c7b6a 100644 --- a/r/adbcsqlite/DESCRIPTION +++ b/r/adbcsqlite/DESCRIPTION @@ -19,6 +19,7 @@ RoxygenNote: 7.2.3 SystemRequirements: SQLite3 Suggests: nanoarrow, + DBItest, testthat (>= 3.0.0) Config/testthat/edition: 3 Config/build/bootstrap: TRUE diff --git a/r/adbcsqlite/tests/testthat/test-DBItest.R b/r/adbcsqlite/tests/testthat/test-DBItest.R new file mode 100644 index 0000000000..4ecf8a2f48 --- /dev/null +++ b/r/adbcsqlite/tests/testthat/test-DBItest.R @@ -0,0 +1,94 @@ + +if (identical(Sys.getenv("NOT_CRAN"), "true") && + packageVersion("DBItest") >= "1.7.2") { + 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`") else x + } + ), + tweaks = suppressWarnings( + DBItest::tweaks( + dbitest_version = "1.8.0", + 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) as.integer(x), + date_typed = FALSE, + time_typed = FALSE, + timestamp_typed = FALSE, + temporary_tables = FALSE, # apache/arrow-adbc#1141 + strict_identifier = TRUE + ) + ), + name = "adbcsqlite" + ) + + DBItest::test_all( + skip = c( + + "package_name", + + # options(adbi.allow_multiple_results = FALSE) + "send_query_only_one_result_set", + "send_statement_only_one_result_set", + "arrow_send_query_only_one_result_set", + + # options(adbi.force_close_results = TRUE) + "send_query_stale_warning", + "send_statement_stale_warning", + "arrow_send_query_stale_warning", + + # int/int64 https://github.com/r-dbi/DBItest/issues/311 + "data_64_bit_numeric", + "data_64_bit_numeric_warning", + "data_64_bit_lossless", + "arrow_read_table_arrow", + + # `field.types` https://github.com/r-dbi/adbi/issues/14 + "append_roundtrip_64_bit_roundtrip", + "roundtrip_64_bit_numeric", + "roundtrip_64_bit_character", + "roundtrip_64_bit_roundtrip", + "roundtrip_field_types", + + # bind zero length https://github.com/apache/arrow-adbc/issues/1365 + "bind_multi_row_zero_length", + "arrow_bind_multi_row_zero_length", + "arrow_stream_bind_multi_row_zero_length", + "stream_bind_multi_row_zero_length", + + # misc issues with well understood causes + "connect_bigint_character", # apache/arrow-nanoarrow#324 + "data_logical", # r-dbi/DBItest#308 + "create_table_visible_in_other_connection", # r-dbi/DBItest#297 + "quote_identifier_string", # apache/arrow-adbc#1395 + + # misc issues with poorly understood causes + "append_table_new", # SQL error + "column_info", + "bind_raw", + "arrow_bind_raw", + "bind_factor", # no warnings? + "arrow_bind_factor", # no warnings? + "read_table_empty", + "list_objects_features", + + # cause segfaults + "begin_write_disconnect", + + if (getRversion() < "4.0") { + c( + "column_info_consistent_keywords", + "column_info_consistent_unnamed", + "column_info_consistent", + "column_info_row_names" + ) + } + ) + ) +} From c45928b8f55e2604bb549126ac2e7fe326040e12 Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Fri, 22 Dec 2023 12:53:42 -0400 Subject: [PATCH 2/8] add adbi to suggests --- r/adbcsqlite/DESCRIPTION | 1 + 1 file changed, 1 insertion(+) diff --git a/r/adbcsqlite/DESCRIPTION b/r/adbcsqlite/DESCRIPTION index cb2d1c7b6a..c06c93d645 100644 --- a/r/adbcsqlite/DESCRIPTION +++ b/r/adbcsqlite/DESCRIPTION @@ -19,6 +19,7 @@ RoxygenNote: 7.2.3 SystemRequirements: SQLite3 Suggests: nanoarrow, + adbi, DBItest, testthat (>= 3.0.0) Config/testthat/edition: 3 From 2b261d367b1469a2412a55452d7e2af09dc20e50 Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Fri, 22 Dec 2023 12:58:06 -0400 Subject: [PATCH 3/8] rat --- r/adbcsqlite/tests/testthat/test-DBItest.R | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/r/adbcsqlite/tests/testthat/test-DBItest.R b/r/adbcsqlite/tests/testthat/test-DBItest.R index 4ecf8a2f48..beb57049c9 100644 --- a/r/adbcsqlite/tests/testthat/test-DBItest.R +++ b/r/adbcsqlite/tests/testthat/test-DBItest.R @@ -1,3 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. if (identical(Sys.getenv("NOT_CRAN"), "true") && packageVersion("DBItest") >= "1.7.2") { From 29473e8108bbc5e4d0b3c8b3b1afa06efd430542 Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Fri, 22 Dec 2023 13:01:10 -0400 Subject: [PATCH 4/8] maybe use dev adbi in CI --- r/adbcsqlite/DESCRIPTION | 1 + 1 file changed, 1 insertion(+) diff --git a/r/adbcsqlite/DESCRIPTION b/r/adbcsqlite/DESCRIPTION index c06c93d645..8fff65d297 100644 --- a/r/adbcsqlite/DESCRIPTION +++ b/r/adbcsqlite/DESCRIPTION @@ -22,6 +22,7 @@ Suggests: adbi, DBItest, testthat (>= 3.0.0) +Config/needs/check: r-dbi/adbi Config/testthat/edition: 3 Config/build/bootstrap: TRUE URL: https://github.com/apache/arrow-adbc, https://arrow.apache.org/adbc/current/r/adbcsqlite/ From 8001df125920d6e80eb5870df9cc2b970a3f8d4c Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Fri, 22 Dec 2023 13:08:52 -0400 Subject: [PATCH 5/8] different approach to adbi in CI --- .github/workflows/r-check.yml | 2 +- r/adbcsqlite/DESCRIPTION | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/r-check.yml b/.github/workflows/r-check.yml index 0b368ca330..1d8c44260d 100644 --- a/.github/workflows/r-check.yml +++ b/.github/workflows/r-check.yml @@ -60,7 +60,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: any::rcmdcheck, local::../adbcdrivermanager + extra-packages: any::rcmdcheck, local::../adbcdrivermanager, r-dbi/adbi needs: check working-directory: r/${{ inputs.pkg }} diff --git a/r/adbcsqlite/DESCRIPTION b/r/adbcsqlite/DESCRIPTION index 8fff65d297..c06c93d645 100644 --- a/r/adbcsqlite/DESCRIPTION +++ b/r/adbcsqlite/DESCRIPTION @@ -22,7 +22,6 @@ Suggests: adbi, DBItest, testthat (>= 3.0.0) -Config/needs/check: r-dbi/adbi Config/testthat/edition: 3 Config/build/bootstrap: TRUE URL: https://github.com/apache/arrow-adbc, https://arrow.apache.org/adbc/current/r/adbcsqlite/ From 6de377cc6c6cc551c6ea654440520304bdc782cb Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Fri, 22 Dec 2023 14:22:59 -0400 Subject: [PATCH 6/8] ensure bit64 is installed for checks --- r/adbcsqlite/DESCRIPTION | 1 + 1 file changed, 1 insertion(+) diff --git a/r/adbcsqlite/DESCRIPTION b/r/adbcsqlite/DESCRIPTION index c06c93d645..0218eaf80b 100644 --- a/r/adbcsqlite/DESCRIPTION +++ b/r/adbcsqlite/DESCRIPTION @@ -22,6 +22,7 @@ Suggests: adbi, DBItest, testthat (>= 3.0.0) +Config/needs/check: bit64 Config/testthat/edition: 3 Config/build/bootstrap: TRUE URL: https://github.com/apache/arrow-adbc, https://arrow.apache.org/adbc/current/r/adbcsqlite/ From ccdb97cc701daf0d3c884aec82e39c23c3bcc798 Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Wed, 27 Dec 2023 12:42:33 -0400 Subject: [PATCH 7/8] Update r/adbcsqlite/tests/testthat/test-DBItest.R MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kirill Müller --- r/adbcsqlite/tests/testthat/test-DBItest.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r/adbcsqlite/tests/testthat/test-DBItest.R b/r/adbcsqlite/tests/testthat/test-DBItest.R index beb57049c9..5c8ac48e00 100644 --- a/r/adbcsqlite/tests/testthat/test-DBItest.R +++ b/r/adbcsqlite/tests/testthat/test-DBItest.R @@ -27,7 +27,7 @@ if (identical(Sys.getenv("NOT_CRAN"), "true") && ), tweaks = suppressWarnings( DBItest::tweaks( - dbitest_version = "1.8.0", + dbitest_version = "1.7.2", constructor_relax_args = TRUE, placeholder_pattern = c("?", "$1", "$name", ":name"), date_cast = function(x) paste0("'", x, "'"), From 3028d20a0efd88e303ba9780085d02dd8c95d62e Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Mon, 1 Apr 2024 16:42:58 -0300 Subject: [PATCH 8/8] add patch --- r/adbcsqlite/tests/testthat/test-DBItest.R | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/r/adbcsqlite/tests/testthat/test-DBItest.R b/r/adbcsqlite/tests/testthat/test-DBItest.R index 5c8ac48e00..e24a68e73a 100644 --- a/r/adbcsqlite/tests/testthat/test-DBItest.R +++ b/r/adbcsqlite/tests/testthat/test-DBItest.R @@ -83,22 +83,19 @@ if (identical(Sys.getenv("NOT_CRAN"), "true") && "data_logical", # r-dbi/DBItest#308 "create_table_visible_in_other_connection", # r-dbi/DBItest#297 "quote_identifier_string", # apache/arrow-adbc#1395 + "read_table_empty", # apache/arrow-adbc#1400 + "list_objects_features", # r-dbi/DBItest#339 # misc issues with poorly understood causes - "append_table_new", # SQL error - "column_info", - "bind_raw", - "arrow_bind_raw", - "bind_factor", # no warnings? - "arrow_bind_factor", # no warnings? - "read_table_empty", - "list_objects_features", + "append_table_new", + "begin_write_commit", # cause segfaults "begin_write_disconnect", if (getRversion() < "4.0") { c( + "column_info", "column_info_consistent_keywords", "column_info_consistent_unnamed", "column_info_consistent",