[sqlalchemy] Re: Migrating from 0.8.2 to 0.9.3 causes ArgumentError

2014-02-23 Thread RedBaron
OK I managed to find the offending part. It seems `options(lazylaod('*'))` which was my default "sledge-hammer" to ensure that only needed tables are joined (to form compact queries) is at fault. Removing `options()` also removes the errors. I understand that in 0.9.x a new `Load` interface was

[sqlalchemy] Migrating from 0.8.2 to 0.9.3 causes ArgumentError

2014-02-23 Thread RedBaron
Hi, After a lot of inertia I finally decided to migrate to 0.9.3 from 0.8.2 (A long jump I know). I re-ran my tests and found a lot of ArgumentErrors. The offending query and the error was sensors = session.query(SensorExtra) .with_entities(SensorExtra.sid.label('sid')) .options(lazyload('*')).f

Re: [sqlalchemy] Could anyone please help explain "expired object" in plain language?

2014-02-23 Thread Michael Bayer
As our documentation ability is growing more sophisticated, I’ve taken advantage of this to update and expand the “Expiration” section of the documentation, including with some links to the outside regarding the important concepts. I’m running out the door and the docs are still building, but i

Re: [sqlalchemy] Association proxy info property (or lack thereof)

2014-02-23 Thread Michael Bayer
On Feb 23, 2014, at 12:59 AM, Josh Kuhn wrote: > I'm writing some code to serialize some SA models to JSON, and for columns > and relationships, it's convenient to tag which fields should be serialized > with the info dictionary like so: > > class Thing(Base): > id = Column(Integer, prima

Re: [sqlalchemy] Could anyone please help explain "expired object" in plain language?

2014-02-23 Thread Gunnlaugur Thor Briem
It means that an object in memory (or some of its attributes), representing an entity in the DB, is no longer considered to reflect the state of that entity accurately because the entity may have changed in the DB. So next time attributes are read from the object, fresh DB state is queried. See htt

Re: [sqlalchemy] index.kwargs no longer assignable with 0.9.x

2014-02-23 Thread chris . dent
On Sun, 23 Feb 2014, Michael Bayer wrote: The overall behavior you're seeing is due to http://docs.sqlalchemy- .org/en/rel_0_9/changelog/changelog_09.html#change- 2df4f7fe29c0f5aa2f957f4a89b0d74d Thanks very much for the quick response. table.mysql_engine = 'InnoDB' should not be having any

Re: [sqlalchemy] index.kwargs no longer assignable with 0.9.x

2014-02-23 Thread Michael Bayer
On Feb 23, 2014, at 10:17 AM, Chris Dent wrote: > > I have some code that worked in 0.8.x but has stopped working in 0.9.x. > > The basic reason is that table.kwargs and index.kwargs are now immutable > dicts. On table objects I can address this by doing e.g.: > > table.mysql_engine = 'I

Re: [sqlalchemy] SQLAlchemy 0.9.2 UnicodeEncodeErrors with PG 9.3.2 on Amazon RDS

2014-02-23 Thread Jeff Dairiki
On Tue, Feb 18, 2014 at 03:46:23PM -0800, Jeff Dairiki wrote: > As a workaround, at app config time, right after create_engine is > called, I execute a query (before there is a possibility of a > multi-thread race.) E.g. > > engine = sa.create_engine(...) > > # early query to force diale

[sqlalchemy] index.kwargs no longer assignable with 0.9.x

2014-02-23 Thread Chris Dent
I have some code that worked in 0.8.x but has stopped working in 0.9.x. The basic reason is that table.kwargs and index.kwargs are now immutable dicts. On table objects I can address this by doing e.g.: table.mysql_engine = 'InnoDB' instead of table.kwargs['mysql_engine'] = 'InnoDB'

[sqlalchemy] Could anyone please help explain "expired object" in plain language?

2014-02-23 Thread Bao Niu
I read the documentation several times yet still didn't find an official definition for "expired object", although it is used quite often. To my understanding, it means when you update some attributes on a persistent object, so those affected attributes that are still lying in database become "

Re: [sqlalchemy] TypeError: Range objects cannot be ordered in flush

2014-02-23 Thread Chris Withers
On 24/12/2013 21:21, Ryan Kelly wrote: IMO psycopg2's implementation should be patched, since they basically just didn't implement ordering. PostgreSQL itself has no problem ordering range types (though the ordering is somewhat arbitrary): http://www.postgresql.org/docs/9.2/static/rangetypes.htm