Bug in getcommitted method in properties.py

Issue #1504 resolved
Former user created an issue

The method getcommitted in sqlalchemy.orm.properties is calling the method get_committed_value without the state.dict parameter. This is causing a stack trace. This has been fixed on the trunk already but the latest released version 0.5.5 is broken and thus automatic buildout does not work.

Module sqlalchemy.orm.attributes, line 158, in get Module sqlalchemy.orm.attributes, line 374, in get Module sqlalchemy.orm.strategies, line 568, in call Module sqlalchemy.orm.query, line 1198, in all Module sqlalchemy.orm.query, line 1292, in iter Module sqlalchemy.orm.query, line 1295, in _execute_and_instances Module sqlalchemy.orm.session, line 754, in execute Module sqlalchemy.engine.base, line 824, in execute Module sqlalchemy.engine.base, line 872, in _execute_clauseelement Module sqlalchemy.engine.base, line 938, in create_execution_context Module sqlalchemy.engine.default, line 167, in __init Module sqlalchemy.sql.compiler, line 243, in construct_params Module sqlalchemy.orm.strategies, line 398, in <lambda> Module sqlalchemy.orm.mapper, line 1089, in _get_committed_attr_by_column Module sqlalchemy.orm.mapper, line 1092, in _get_committed_state_attr_by_column Module sqlalchemy.orm.properties, line 166, in getcommitted TypeError: get_committed_value() takes at least 3 non-keyword arguments (2 given)

Comments (4)

  1. Mike Bayer repo owner
    • changed milestone to 0.5.6

    there are two calls to get_committed_value() in properties.py, one is extremely common and associated with ColumnProperty, the other is apparently uncovered by tests since it would only be called if a CompositeProperty were used around a set of foreign key columns (something that hasn't been tried). your stack trace indicates line 166 which would suggest the latter.

    the ColumnProprerty version is correct in all branches of SQLAlchemy. The CompositeProperty based on visual inspection is not fixed in any branch of SQLAlchemy, 0.5.4, 0.5.4p1, 0.5.5, 0.5.6, trunk. Please attach a test case that confirms the method you're referring towards and can be adapted into a unit test for this issue.

  2. Log in to comment