On 5/8/15 9:23 AM, Marcus Cobden wrote:
I've found some rather unexpected behavior when using
joinedload(...).load_only
https://bpaste.net/show/57322148e56f
The ex.description attribute is loaded on the first result, but not on
the second, even though all the data is part of the result.
It looks like the data is discarded when the joinedload is processed.
What is the expected behavior here?
the expected behavior is that the first pathway where an Example object
is seen is the pathway that will handle its loading. By "pathway", this
load has two general paths:
Example
Example.children
Therefore, when the rows come back with joinedload, we see the row for
Example "one" with additional columns that contain the row for Example
"two". Both objects are loaded. The load_only("id") is applied to
Example as requested; "description" is not loaded.
Then, another row comes in. This is the row where the primary columns
are that of Example "two" - the additional columns are NULL. This
object is already loaded. The object is retrieved from the identity map
and placed into the query results unchanged. The data within this row
is not used because the object is already loaded.
Thanks,
Marcus
(Thanks to agronholm on IRC for taking an initial look at this)
--
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 sqlalchemy+unsubscr...@googlegroups.com
<mailto:sqlalchemy+unsubscr...@googlegroups.com>.
To post to this group, send email to sqlalchemy@googlegroups.com
<mailto:sqlalchemy@googlegroups.com>.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
--
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 sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.