This is an automated email from the ASF dual-hosted git repository.

paleolimbot pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/sedona-db.git


The following commit(s) were added to refs/heads/main by this push:
     new 36ab4c16 fix(python/sedonadb): support DuckDB 1.5 spatial tests (#700)
36ab4c16 is described below

commit 36ab4c1615a5e8077661e61d7b3d4732c0267936
Author: Kristin Cowalcijk <[email protected]>
AuthorDate: Tue Mar 10 03:51:46 2026 +0800

    fix(python/sedonadb): support DuckDB 1.5 spatial tests (#700)
---
 python/sedonadb/python/sedonadb/testing.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/python/sedonadb/python/sedonadb/testing.py 
b/python/sedonadb/python/sedonadb/testing.py
index 3c7d2e8a..86712c1c 100644
--- a/python/sedonadb/python/sedonadb/testing.py
+++ b/python/sedonadb/python/sedonadb/testing.py
@@ -383,7 +383,13 @@ class DuckDB(DBEngine):
         self.con = duckdb.connect()
         self.con.install_extension("spatial")
         self.con.load_extension("spatial")
-        self.con.sql("CALL register_geoarrow_extensions()")
+        needs_geoarrow_registration = self.con.sql(
+            "SELECT count(*) > 0 FROM duckdb_functions() "
+            "WHERE function_name = 'register_geoarrow_extensions'"
+        ).fetchone()[0]
+
+        if needs_geoarrow_registration:
+            self.con.sql("CALL register_geoarrow_extensions()")
 
     @classmethod
     def name(cls):
@@ -422,7 +428,7 @@ class DuckDB(DBEngine):
         return self
 
     def execute_and_collect(self, query) -> pa.Table:
-        return self.con.sql(query).fetch_arrow_table()
+        return self.con.execute(query).arrow().read_all()
 
 
 class DuckDBSingleThread(DuckDB):

Reply via email to