Re: [Sqlalchemy-tickets] [sqlalchemy] #2887: subqueryload query invokes ahead of parent loader init
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2013-12-11 17:36:04
|
#2887: subqueryload query invokes ahead of parent loader init, can cause conflicts
------------------------------+-------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: new
Priority: high | Milestone: 0.8.xx
Component: orm | Severity: major - 1-3 hours
Resolution: | Keywords:
Progress State: in progress |
------------------------------+-------------------------------
Comment (by zzzeek):
at least some of the tests that fail are because they rely upon
subqueryload to emit its query and load further related objects, even when
the lead object otherwise is not subject to any row processing at all:
{{{
u1 =
sess.query(User).filter_by(id=7).options(subqueryload("orders")).one()
# id=7 is already loaded, no row processing for this User will
take effect.
# but we still want orders.items to get populated on the existing
orders.
sess.query(User).filter_by(id=7).options(subqueryload_all("orders.items")).first()
assert 'items' in u1.orders[0].__dict__
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2887#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|