[Sqlalchemy-tickets] Issue #4256: SQLAlchemy 1.2.7 breaks dogpile caching example (zzzeek/sqlalchem
Brought to you by:
zzzeek
From: Frazer M. <iss...@bi...> - 2018-05-16 14:30:46
|
New issue 4256: SQLAlchemy 1.2.7 breaks dogpile caching example https://bitbucket.org/zzzeek/sqlalchemy/issues/4256/sqlalchemy-127-breaks-dogpile-caching Frazer McLean: To reproduce: ``` python3 -m examples.dogpile_caching.advanced ``` ``` Traceback (most recent call last): File "/Users/frazer/.pyenv/versions/3.6.5/lib/python3.6/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/Users/frazer/.pyenv/versions/3.6.5/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/Users/frazer/projects/personal/sqlalchemy/examples/dogpile_caching/advanced.py", line 68, in <module> print(p.format_full()) File "/Users/frazer/projects/personal/sqlalchemy/examples/dogpile_caching/model.py", line 95, in format_full return "\t".join([str(x) for x in [self] + list(self.addresses)]) File "/Users/frazer/projects/personal/sqlalchemy/examples/dogpile_caching/model.py", line 95, in <listcomp> return "\t".join([str(x) for x in [self] + list(self.addresses)]) File "/Users/frazer/projects/personal/sqlalchemy/examples/dogpile_caching/model.py", line 74, in __str__ "%s" % (self.street, self.city.name, File "/Users/frazer/projects/personal/sqlalchemy/examples/dogpile_caching/model.py", line 65, in city return self.postal_code.city File "/Users/frazer/.pyenv/versions/3.6.5/lib/python3.6/site-packages/sqlalchemy/orm/attributes.py", line 242, in __get__ return self.impl.get(instance_state(instance), dict_) File "/Users/frazer/.pyenv/versions/3.6.5/lib/python3.6/site-packages/sqlalchemy/orm/attributes.py", line 599, in get value = self.callable_(state, passive) File "/Users/frazer/.pyenv/versions/3.6.5/lib/python3.6/site-packages/sqlalchemy/orm/strategies.py", line 619, in _load_for_state instance = session._query_cls._identity_lookup( AttributeError: 'function' object has no attribute '_identity_lookup' ``` See [this commit](https://bitbucket.org/zzzeek/sqlalchemy/commits/43f278356d94b5342a1020a9a97feea0bb7cd88f#Llib/sqlalchemy/orm/strategies.pyT619) As of 1.2.7 `session._query_cls` is expected to be a class, but previously the function returned by `query_callable` in the dogpile caching example worked. |