lidavidm commented on code in PR #4098:
URL: https://github.com/apache/arrow-adbc/pull/4098#discussion_r2972509260


##########
python/adbc_driver_postgresql/tests/test_dbapi.py:
##########
@@ -586,3 +586,90 @@ def test_server_terminates_connection(postgres_uri: str) 
-> None:
             with pytest.raises(Exception):
                 with conn2.cursor() as cur:
                     cur.execute("SELECT 1")
+
+
+# Tests for issue #3549: Cannot use null values as bound parameters
+def test_bind_null_insert(postgres: dbapi.Connection) -> None:
+    """Test INSERT with None parameter (issue #3549)."""
+    with postgres.cursor() as cur:
+        cur.execute("DROP TABLE IF EXISTS test_null_binding")
+        cur.execute("CREATE TABLE test_null_binding(a TEXT, b INT)")
+        # This should not raise an error about mapping Arrow type 'na' to 
Postgres type
+        cur.execute("INSERT INTO test_null_binding VALUES ($1, $2)", ("hello", 
None))
+    postgres.commit()

Review Comment:
   Maybe query the data back and ensure it's as expected?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to