_determine_joins raises TypeError: 'dict_values' object does not support indexing
Issue #3005
resolved
Python 3.4.0, sqlalchemy master
When using sadisplay (https://pypi.python.org/pypi/sadisplay) like this:
desc = sadisplay.describe(getattr(db, attr) for attr in dir(db))
I get an exception:
#!
File "...venv\lib\site-packages\sadisplay\describe.py", line 100, in describe
mapper = class_mapper(item)
File "...venv\lib\site-packages\sqlalchemy\orm\base.py", line 378, in class_mapper
mapper = _inspect_mapped_class(class_, configure=configure)
File "...venv\lib\site-packages\sqlalchemy\orm\base.py", line 355, in _inspect_mapped_class
mapper._configure_all()
File "...venv\lib\site-packages\sqlalchemy\orm\mapper.py", line 1129, in _configure_all
configure_mappers()
File "...venv\lib\site-packages\sqlalchemy\orm\mapper.py", line 2544, in configure_mappers
mapper._post_configure_properties()
File "...venv\lib\site-packages\sqlalchemy\orm\mapper.py", line 1657, in _post_configure_properties
prop.init()
File "...venv\lib\site-packages\sqlalchemy\orm\interfaces.py", line 143, in init
self.do_init()
File "...venv\lib\site-packages\sqlalchemy\orm\relationships.py", line 1510, in do_init
self._setup_join_conditions()
File "...venv\lib\site-packages\sqlalchemy\orm\relationships.py", line 1586, in _setup_join_conditions
can_be_synced_fn=self._columns_are_mapped
File "...venv\lib\site-packages\sqlalchemy\orm\relationships.py", line 1849, in __init__
self._determine_joins()
File "...venv\lib\site-packages\sqlalchemy\orm\relationships.py", line 1932, in _determine_joins
consider_as_foreign_keys=consider_as_foreign_keys
File "<string>", line 2, in join_condition
File "...venv\lib\site-packages\sqlalchemy\sql\selectable.py", line 764, in _join_condition
crit = [(x == y) for x, y in constraints.values()[0]]
TypeError: 'dict_values' object does not support indexing
This used to work a couple of days ago with sqlalchemy master.
Comments (6)
-
repo owner -
reporter Not sure. I've got diagram generation in the makefile for the project and this line
desc = sadisplay.describe(getattr(db, attr) for attr in dir(db))
is the only related code I control. I can try cutting the DB model and checking what happens.
-
repo owner oh nevermind its just a py3k regression from yesterday.
-
repo owner e.g. tons of tests fail
-
repo owner - changed status to resolved
- fix py3k bug re: dictionary values(), fixes
#3005
→ <<cset 610e0594e249>>
-
reporter k thx
- Log in to comment
this is from 825d3b0d6db4b4db78d69b can you please provide a succinct test case? thanks.