You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by li...@apache.org on 2025/02/04 05:32:06 UTC

(arrow-adbc) branch main updated: test(python/adbc_driver_postgresql): fix typecheck error on py3.9 (#2502)

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

lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git


The following commit(s) were added to refs/heads/main by this push:
     new b49201c6a test(python/adbc_driver_postgresql): fix typecheck error on py3.9 (#2502)
b49201c6a is described below

commit b49201c6aa6072b159cf7523cb253dbe68192a5e
Author: David Li <li...@gmail.com>
AuthorDate: Tue Feb 4 00:32:00 2025 -0500

    test(python/adbc_driver_postgresql): fix typecheck error on py3.9 (#2502)
    
    `datetime.UTC` only exists on Python >= 3.11 (we only run this test on a
    single Python version so we didn't notice it earlier). Use
    `datetime.timezone.utc` which should always exist.
---
 ci/conda_env_python.txt                           | 1 +
 python/adbc_driver_postgresql/tests/test_dbapi.py | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/ci/conda_env_python.txt b/ci/conda_env_python.txt
index 8be410973..d0d4de475 100644
--- a/ci/conda_env_python.txt
+++ b/ci/conda_env_python.txt
@@ -20,6 +20,7 @@ importlib-resources
 # nodejs is required by pyright
 nodejs >=13.0.0
 pandas
+pip
 pyarrow-all
 pyright
 pytest
diff --git a/python/adbc_driver_postgresql/tests/test_dbapi.py b/python/adbc_driver_postgresql/tests/test_dbapi.py
index 4efd83325..7f8a39971 100644
--- a/python/adbc_driver_postgresql/tests/test_dbapi.py
+++ b/python/adbc_driver_postgresql/tests/test_dbapi.py
@@ -430,7 +430,7 @@ def test_ingest_large(postgres: dbapi.Connection) -> None:
 def test_timestamp_txn(postgres: dbapi.Connection) -> None:
     """Regression test for #2410."""
     ts = datetime.datetime.now()
-    ts_with_tz = datetime.datetime.now(tz=datetime.UTC)
+    ts_with_tz = datetime.datetime.now(tz=datetime.timezone.utc)
 
     with postgres.cursor() as cur:
         cur.execute("DROP TABLE IF EXISTS ts_txn")