veekun / spline-pokedex

heart and soul of veekun's pokédex
http://bugs.veekun.com/projects/spline-pokedex
MIT License
14 stars 7 forks source link

LoaderStrategyException under SQLAlchemy 1.3 #129

Closed magical closed 4 years ago

magical commented 4 years ago

Attempting to access the ability list triggers the following exception when using SQLAlchemy 1.3.18. The page loads fine with SQLAlchemy 1.2.19.

http://localhost:5001/dex/abilities LoaderStrategyException: Can't apply "joined loader" strategy to property "ability_prose.short_effect", which is a "column property"; this loader strategy is intended to be used with a "relationship property".)

File '.../veekun/spline-pokedex/splinext/pokedex/controllers/pokedex.py', line 1687 in abilities_list
  .options(joinedload('prose.short_effect')) \
File '.../veekun/env-prod/lib/python2.7/site-packages/sqlalchemy/orm/query.py', line 1612 in options
  return self._options(False, *args)
File '', line 2 in _options
File '.../veekun/env-prod/lib/python2.7/site-packages/sqlalchemy/orm/base.py', line 227 in generate
  fn(self, *args[1:], **kw)
File '.../veekun/env-prod/lib/python2.7/site-packages/sqlalchemy/orm/query.py', line 1631 in _options
  opt.process_query(self)
File '.../veekun/env-prod/lib/python2.7/site-packages/sqlalchemy/orm/strategy_options.py', line 175 in process_query
  self._process(query, True)
File '.../veekun/env-prod/lib/python2.7/site-packages/sqlalchemy/orm/strategy_options.py', line 665 in _process
  raiseerr,
File '.../veekun/env-prod/lib/python2.7/site-packages/sqlalchemy/orm/strategy_options.py', line 845 in _bind_loader
  raiseerr,
File '.../veekun/env-prod/lib/python2.7/site-packages/sqlalchemy/orm/strategy_options.py', line 322 in _generate_path
  found_property._get_strategy(for_strategy)
File '.../veekun/env-prod/lib/python2.7/site-packages/sqlalchemy/orm/interfaces.py', line 543 in _get_strategy
  cls = self._strategy_lookup(self, *key)
File '.../veekun/env-prod/lib/python2.7/site-packages/sqlalchemy/orm/interfaces.py', line 622 in _strategy_lookup
  key,
LoaderStrategyException: Can't apply "joined loader" strategy to property "ability_prose.short_effect", which is a "column property"; this loader strategy is intended to be used with a "relationship property".
magical commented 4 years ago

Test suite passes under SQLAlchemy 1.3 with this issue fixed.