insitro/redun

SQLalchemy caching warning

bbremer opened this issue · 3 comments

I get the following warning in stdout with SQLAlchemy version 1.4.28:

/opt/miniconda3/envs/key-test/lib/python3.7/site-packages/redun/backends/db/__init__.py:1937: SAWarning: Class Column will not make use of SQL compilation caching as it does not set the 'inherit_cache' attribute to ``True``. This can have significant performance implications including some performance degradations in comparison to prior SQLAlchemy versions. Set this attribute to True if this object can make use of the cache key generated by the superclass. Alternatively, this attribute may be set to False which will disable this warning. (Background on this error at: https://sqlalche.me/e/14/cprf)

Setting inherit_cache = True as a Column class variable fixes the error as suggested above. Is this correct in regards to redun functionality?

ctk3b commented

Thank you for the report! Could you share a piece of code that reproduces this issue with SQLAlchemy version 1.4.28?

Any redun script I run results in this warning, including the 01_hello_world tutorial. I replicated it in both conda (Python 3.7, redun installed as a pip dependency) and a fresh Python 3.9.5 venv with:

pip install redun
redun run hello_world.py main

I'm on macOS if that makes a difference.

Thanks for reporting! This has been fix in main via 91a81ac. We'll produce a new package release soon that will include the fix as well.