Greetings,
[SQLAlchemy 1.0.12]
We have observed situations in which the first in a list of objects
returned by a query with options(subqueryload(Class.relationship)) or with
lazy=subquery will have a missing relationship.
This is some pseudocode
[...]
class Parent(Base):
id = Column(Integer, primary_key=True)
class Child(Base):
id = Column(Integer, primary_key=True)
parent_id = Column(Integer, ForeignKey(Parent.id))
Child.parent = relationship(Parent, lazy='subquery')
[...]
children = session.query(Child).all()
children[0].parent_id not None
children[0].parent None!!!
children[1].parent_id not None
children[1].parent not None
If I change the strategy to eager or lazy='select' things are fine.
I have not successfully isolated this issue into a toy model, but I'd be
happy to dig deeper if pointed to the relevant code. I can reproduce this
in our code easily.
Thanks!
Marco
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.