mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
fd5f6e1b65
Filtering on pokemon name was broken. Not sure why, since the search CLI was added way after the i18n stuff was added. The error is related to AssociationProxy, which figures because nothing about association proxies ever seems to work right. I don't know enough about SQLAlchemy internals to know if what it was trying to do was supposed to work, or how to fix it if so. So, fix it by using the same boring join-based filtering that spline-pokedex uses. Running `pokedex search --name=gloom` caused the following error with PostgreSQL and SQLAlchemy 1.3.5: sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) can't adapt type 'ColumnAssociationProxyInstance' ...and this error with SQLite. sqlalchemy.exc.InterfaceError: (sqlite3.InterfaceError) Error binding parameter 4 - probably unsupported type. [parameters: (9, 9, 9, 9, ColumnAssociationProxyInstance(AssociationProxy('names_local', 'name')), 'gloom')] Additionaly, the following error would happen with PostgreSQL and SQLAlchemy 0.9.7, but that's probably unrelated: sqlalchemy.exc.ProgrammingError: (ProgrammingError) subquery in FROM must have an alias LINE 4: FROM pokemon_species, (SELECT pokemon_species_names.name AS ... ^ Fixes #296 |
||
---|---|---|
.. | ||
cli | ||
data/csv | ||
db | ||
doc | ||
struct | ||
tests | ||
util | ||
__init__.py | ||
__main__.py | ||
compatibility.py | ||
defaults.py | ||
formulae.py | ||
lookup.py | ||
main.py | ||
roomaji.py | ||
search.py |