Inplace set operations broken

Issue #920 resolved
Former user created an issue

The _set_decorators() functions in orm/collections.py defines several "update" functions which it then aliases to inplace-assignment operators like __and__ and __or__. However, none of the functions are actually capable of standing in for these operators, since doing so requires a function to return the new, mutated object as its return value. Since none of the functions, as they stand, has a return statement, they all result in inplace assignments that result in None objects.

Comments (4)

  1. Former user Account Deleted

    It turns out that all of the inplace-assignment set operations in ext/associationproxy.py have the same problem.

  2. Former user Account Deleted

    And, the ext/associationproxy.py routines have an additional problem, which is that the attempt that Python makes to do the assignment of the attribute to its own value breaks the instance in such a way that, at session flushing time, SQLAlchemy reports:

    sqlalchemy.exceptions.AssertionError: Dependency rule tried to blank-out primary key column 'account_categories.account$' on instance 'AccountCategory@0xa47bacc'
    
  3. Log in to comment