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

stoty pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix-queryserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 30c523f  PHOENIX-6735 Add supports_statement_cache attribute for 
SqlAlchemy dialect
30c523f is described below

commit 30c523f964a11704169d1b579431fb15373e5991
Author: Istvan Toth <st...@cloudera.com>
AuthorDate: Thu Jun 16 15:37:21 2022 +0200

    PHOENIX-6735 Add supports_statement_cache attribute for SqlAlchemy dialect
    
    also fix two pytest deprecation warnings
---
 python-phoenixdb/NEWS.rst                        | 4 ++++
 python-phoenixdb/phoenixdb/sqlalchemy_phoenix.py | 2 ++
 python-phoenixdb/phoenixdb/tests/test_dbapi20.py | 4 ++--
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/python-phoenixdb/NEWS.rst b/python-phoenixdb/NEWS.rst
index 5d9dfc8..26874ad 100644
--- a/python-phoenixdb/NEWS.rst
+++ b/python-phoenixdb/NEWS.rst
@@ -1,6 +1,10 @@
 Changelog
 =========
 
+Version 1.2.0
+-------------
+- Added supports_statement_cache attribute for SqlAlchemy dialect to avoid 
warnings (PHOENIX-6735)
+
 Version 1.1.0
 -------------
 
diff --git a/python-phoenixdb/phoenixdb/sqlalchemy_phoenix.py 
b/python-phoenixdb/phoenixdb/sqlalchemy_phoenix.py
index 15acdd1..486cd89 100644
--- a/python-phoenixdb/phoenixdb/sqlalchemy_phoenix.py
+++ b/python-phoenixdb/phoenixdb/sqlalchemy_phoenix.py
@@ -90,6 +90,8 @@ class PhoenixDialect(DefaultDialect):
 
     driver = "phoenixdb"
 
+    supports_statement_cache = False  # We only implement textual SQL anyway
+
     ddl_compiler = PhoenixDDLCompiler
 
     execution_ctx_cls = PhoenixExecutionContext
diff --git a/python-phoenixdb/phoenixdb/tests/test_dbapi20.py 
b/python-phoenixdb/phoenixdb/tests/test_dbapi20.py
index c80ecb4..67a8ec8 100644
--- a/python-phoenixdb/phoenixdb/tests/test_dbapi20.py
+++ b/python-phoenixdb/phoenixdb/tests/test_dbapi20.py
@@ -105,7 +105,7 @@ class PhoenixDatabaseAPI20Test(dbapi20.DatabaseAPI20Test):
             # no rows
             cur.execute('select name from %sbooze' % self.table_prefix)
             self.assertRaises(StopIteration, cur.next)
-            self.failUnless(cur.rowcount in (-1, 0))
+            self.assertTrue(cur.rowcount in (-1, 0))
 
             # cursor.next should raise an Error if called after
             # executing a query that cannnot return rows
@@ -120,6 +120,6 @@ class PhoenixDatabaseAPI20Test(dbapi20.DatabaseAPI20Test):
             self.assertEqual(r[0], 'Victoria Bitter', 'cursor.next retrieved 
incorrect data')
             # cursor.next should raise StopIteration if no more rows available
             self.assertRaises(StopIteration, cur.next)
-            self.failUnless(cur.rowcount in (-1, 1))
+            self.assertTrue(cur.rowcount in (-1, 1))
         finally:
             con.close()

Reply via email to