sqlathanor
sqlathanor copied to clipboard
SAWarning: Class AnnotatedColumn will not make use of SQL compilation
Problem:
I'm experiencing some warnings when I do use sqlathanor.declarative_base
:
SAWarning: Class AnnotatedColumn 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)
My environment is:
SQLAlchemy==1.4.31
sqlathanor==0.7.0
Does anyone experience the same warnings? I can't sleep knowing that this can have significant performance implications....
https://github.com/sqlalchemy/sqlalchemy/discussions/7766 I've forwarded this issue to SQLAlchemy and the answer is clear. The subclass must override inherit_cache
so the attached PR still holds valid I believe.