This is an automated email from the ASF dual-hosted git repository.
raulcd pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new d6bba6b340 GH-50219: [R] Fix duckdb test for dbplyr 2.6.0 (#50220)
d6bba6b340 is described below
commit d6bba6b3406430c2a290a7ab575988d90c3ef2e0
Author: Nic Crane <[email protected]>
AuthorDate: Mon Jun 22 08:53:44 2026 +0100
GH-50219: [R] Fix duckdb test for dbplyr 2.6.0 (#50220)
### Rationale for this change
dbplyr 2.6.0 changed `remote_con()` to read from `x$con` instead of
`x$src$con`. The duckdb test that simulates a non-DuckDB connection was
overriding the old path, so the expected error was no longer thrown.
### What changes are included in this PR?
Update the test to override `ds_rt$con` instead of `ds_rt$src$con`.
### Are these changes tested?
This is a test fix — the test itself verifies the behavior.
### Are there any user-facing changes?
No.
* GitHub Issue: #50219
Authored-by: Nic Crane <[email protected]>
Signed-off-by: Raúl Cumplido <[email protected]>
---
r/tests/testthat/test-duckdb.R | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/r/tests/testthat/test-duckdb.R b/r/tests/testthat/test-duckdb.R
index 8b572268e3..c0e6902648 100644
--- a/r/tests/testthat/test-duckdb.R
+++ b/r/tests/testthat/test-duckdb.R
@@ -123,13 +123,17 @@ test_that("to_duckdb then to_arrow", {
)
# Now check errors
+ # dbplyr 2.6.0 added "con" to the allowed $ fields on tbl_lazy;
+ # older versions only allow "src" and "lazy_query"
+ skip_if(packageVersion("dbplyr") < "2.6.0")
+
ds_rt <- ds |>
to_duckdb() |>
# factors don't roundtrip https://github.com/duckdb/duckdb/issues/1879
select(-fct)
# alter the class of ds_rt's connection to simulate some other database
- class(ds_rt$src$con) <- "some_other_connection"
+ class(ds_rt$con) <- "some_other_connection"
expect_error(
to_arrow(ds_rt),