get_all_pending() takes 3 positional arguments but 4 were given

Issue #3099 resolved
NotTheEvilOne created an issue

Hi,

the "autoflush" feature triggers an error in SQLAlchemy 0.9.6.

  File "/opt/pas/src/dNG/pas/data/upnp/resources/mp_entry.py", line 588, in init_cds_id
    .first()
  File "/usr/lib/python3.4/site-packages/sqlalchemy/orm/query.py", line 2334, in first
    ret = list(self[0:1])
  File "/usr/lib/python3.4/site-packages/sqlalchemy/orm/query.py", line 2201, in __getitem__
    return list(res)
  File "/usr/lib/python3.4/site-packages/sqlalchemy/orm/query.py", line 2404, in __iter__
    self.session._autoflush()
  File "/usr/lib/python3.4/site-packages/sqlalchemy/orm/session.py", line 1188, in _autoflush
    self.flush()
  File "/usr/lib/python3.4/site-packages/sqlalchemy/orm/session.py", line 1907, in flush
    self._flush(objects)
  File "/usr/lib/python3.4/site-packages/sqlalchemy/orm/session.py", line 2025, in _flush
    transaction.rollback(_capture_exception=True)
  File "/usr/lib/python3.4/site-packages/sqlalchemy/util/langhelpers.py", line 57, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/usr/lib/python3.4/site-packages/sqlalchemy/util/compat.py", line 172, in reraise
    raise value
  File "/usr/lib/python3.4/site-packages/sqlalchemy/orm/session.py", line 1989, in _flush
    flush_context.execute()
  File "/usr/lib/python3.4/site-packages/sqlalchemy/orm/unitofwork.py", line 350, in execute
    postsort_actions = self._generate_actions()
  File "/usr/lib/python3.4/site-packages/sqlalchemy/orm/unitofwork.py", line 324, in _generate_actions
    for rec in cycles
  File "/usr/lib/python3.4/site-packages/sqlalchemy/orm/unitofwork.py", line 324, in <genexpr>
    for rec in cycles
  File "/usr/lib/python3.4/site-packages/sqlalchemy/orm/unitofwork.py", line 541, in per_state_flush_actions
    dep.per_state_flush_actions(uow, states_for_prop, False)
  File "/usr/lib/python3.4/site-packages/sqlalchemy/orm/dependency.py", line 166, in per_state_flush_actions
    else attributes.PASSIVE_NO_INITIALIZE)
TypeError: get_all_pending() takes 3 positional arguments but 4 were given

I think it's related to commit 69dbcdd which in turn is related to #3060 as far as I understand.

Best regards Tobias

Comments (6)

  1. Mike Bayer repo owner

    a test case would be helpful here but I'm assuming this has to do with a "dynamic" relationship.

  2. Mike Bayer repo owner
    • Fixed bug involving dynamic attributes, that was again a regression of 🎫3060 from verision 0.9.5. A self-referential relationship with lazy='dynamic' would raise a TypeError within a flush operation. fixes #3099

    → <<cset f2cf62090c4f>>

  3. Mike Bayer repo owner
    • Fixed bug involving dynamic attributes, that was again a regression of 🎫3060 from verision 0.9.5. A self-referential relationship with lazy='dynamic' would raise a TypeError within a flush operation. fixes #3099

    → <<cset 3494c525eca4>>

  4. Log in to comment