ibmdb / python-ibmdbsa

Automatically exported from code.google.com/p/ibm-db.ibm-db-sa
Apache License 2.0
40 stars 59 forks source link

sqlalchemy 1.4.31 'supports_statement_cache' warning #106

Closed imavo closed 2 years ago

imavo commented 2 years ago

Using sqlalchemy 1.4.31 with python 3.9 , or python 3.10, both on linux x64, and on microsoft-windows-10. with ibm_db 3.1.1 and ibm_db_sa 0.3.7 with jupyter-notebook (classic interface) and ipython-sql 0.4.0.

The first query run against a Db2 database in any session throws a warning (see below), after which the warning will not re-appear, until a new session of jupyter-notebook gets started. The warning does not impact the result-set which appears as normal.

The text of the warning from sqlalchemy is:

/home/userxxxx/venv1/lib/python3.9/site-packages/sql/run.py:367:

SAWarning: Dialect ibm_db_sa:ibm_db_sa will not make use of SQL compilation caching as it does not set the 'supports_statement_cache' attribute to True.

This can have significant performance implications including some performance degradations in comparison to prior SQLAlchemy versions.

Dialect maintainers should seek to set this attribute to True after appropriate development and testing for SQLAlchemy 1.4 caching support.

Alternatively, this attribute may be set to False which will disable this warning. (Background on this error at: https://sqlalche.me/e/14/cprf)

To see the warning, use at least the above versions of components mentioned:

open a blank jupyter-notebook %load_ext sql %env DATABASE_URL=...(to match your database) %sql select * from someschema.sometable

amukherjee28 commented 2 years ago

@imavo I do see this error as well. Working on this to get it fixed in the new release.

frbelotto commented 2 years ago

This message still appears.