Re: [sqlalchemy] Setting query options - strange behavior

2018-10-15 Thread Bartosz Stalewski
Yep, using populate_existing() in the second query makes test_2 work. W dniu poniedziałek, 15 października 2018 15:41:23 UTC+2 użytkownik Mike Bayer napisał: > > On Mon, Oct 15, 2018 at 9:27 AM Simon King > wrote: > > > > This is an interesting question. Here's my explanation of what's going

Re: [sqlalchemy] Setting query options - strange behavior

2018-10-15 Thread Bartosz Stalewski
Yep, it totally makes sense. When it comes to the question you suggested, it seems to me misleading that query parameters may affect further queries. On the other hand, I understand that there are some optimizations in sqlalchemy which may cause behavior such as this. That's why I am not sure if

Re: [sqlalchemy] Setting query options - strange behavior

2018-10-15 Thread Mike Bayer
On Mon, Oct 15, 2018 at 9:27 AM Simon King wrote: > > This is an interesting question. Here's my explanation of what's going on: > > When you run a query using a loader option such as raiseload, > SQLAlchemy constructs your instance and attaches the "raiseload" > behaviour to that instance. In you

Re: [sqlalchemy] Setting query options - strange behavior

2018-10-15 Thread Simon King
This is an interesting question. Here's my explanation of what's going on: When you run a query using a loader option such as raiseload, SQLAlchemy constructs your instance and attaches the "raiseload" behaviour to that instance. In your test_1, this happens, but since you don't store the result,

[sqlalchemy] Setting query options - strange behavior

2018-10-15 Thread Bartosz Stalewski
Hi, I observed some strange (for me) behavior related to setting query options. I am not sure if it works as intended or it is a bug. It seems to me that options are applied to query in a strange manner. The posted below the code that show this behavior: 1) in both tests I am configuring sqlalch