Re: [sqlalchemy] Re: subqueryload with multiple joined table inheritance hierarchies

2016-08-12 Thread Douglas Russell
Sorry to return again so soon, but I think I have uncovered a bug in the subqueryload. Continuing my example above. I had some with_polymorphic subqueries, followed by a non-polymorphic subquery. r = session.query( B ).options( subqueryload( B.cs.of_type(c_c2)

Re: [sqlalchemy] Re: subqueryload with multiple joined table inheritance hierarchies

2016-08-11 Thread Douglas Russell
Thanks for your help, Mike! Douglas On Thu, 11 Aug 2016 at 17:14 Mike Bayer wrote: > > > On 08/11/2016 03:35 PM, Douglas Russell wrote: > > Of course! That makes sense. > > > > Does SQLAlchemy just discard the subqueryload chain parts that are on > > the wrong type?

Re: [sqlalchemy] Re: subqueryload with multiple joined table inheritance hierarchies

2016-08-11 Thread Mike Bayer
On 08/11/2016 03:35 PM, Douglas Russell wrote: Of course! That makes sense. Does SQLAlchemy just discard the subqueryload chain parts that are on the wrong type? It didn't seem to generate any SQL for those when they were wrong. it validates the path as far as classes / attributes, but I

Re: [sqlalchemy] Re: subqueryload with multiple joined table inheritance hierarchies

2016-08-11 Thread Douglas Russell
Of course! That makes sense. Does SQLAlchemy just discard the subqueryload chain parts that are on the wrong type? It didn't seem to generate any SQL for those when they were wrong. An example of this in the docs would be a great idea I think as I think it's pretty tough to explain this in

Re: [sqlalchemy] Re: subqueryload with multiple joined table inheritance hierarchies

2016-08-11 Thread Mike Bayer
On 08/11/2016 09:53 AM, Douglas Russell wrote: of_type was what I was searching for. Thanks. Unfortunately, it did not yield the desired results when I extended the hierarchy to 3 levels (C->C2 with a relation between B and C). I've updated the Gist. B+B2 is successfully queried, but C+C2

[sqlalchemy] Re: subqueryload with multiple joined table inheritance hierarchies

2016-08-11 Thread Douglas Russell
of_type was what I was searching for. Thanks. Unfortunately, it did not yield the desired results when I extended the hierarchy to 3 levels (C->C2 with a relation between B and C). I've updated the Gist. B+B2 is successfully queried, but C+C2 is not. This will then result in lazily generated

[sqlalchemy] Re: subqueryload with multiple joined table inheritance hierarchies

2016-08-10 Thread Douglas Russell
Finally, you can't see it on the Gist, but there is a branch on the repo if you clone it called 'more_relations' with the code for my joinedload test. Sorry for 3 posts where 1 would have been better! Thanks On Wednesday, 10 August 2016 18:18:27 UTC-4, Douglas Russell wrote: > > Hi, > > I have

[sqlalchemy] Re: subqueryload with multiple joined table inheritance hierarchies

2016-08-10 Thread Douglas Russell
Scratch that last bit about the joinedload working. It does succeed in doing the joinedload to get all the data in one go, but it still lazy loads the B2 fields despite them already having been queried. On Wednesday, 10 August 2016 18:18:27 UTC-4, Douglas Russell wrote: > > Hi, > > I have two