Re: [sqlalchemy] Non backwards-compatible changes in 1.0? Lots of suddenly failing tests here.

2015-04-22 Thread Guido Winkelmann
On Wednesday 22 April 2015 14:17:02 Mike Bayer wrote: On 4/22/15 12:45 AM, Oliver Palmer wrote: We're using a Flask extension to work with sqlalchemy called flask-sqlalchemy. The engine is usually not directly exposed but echo can be enabled using a configuration var

Re: [sqlalchemy] Non backwards-compatible changes in 1.0? Lots of suddenly failing tests here.

2015-04-21 Thread Guido Winkelmann
On Monday 20 April 2015 13:24:49 Michael Bayer wrote: On Apr 20, 2015, at 12:56 PM, Guido Winkelmann guido@ambient- entertainment.de wrote: On Monday 20 April 2015 11:23:06 Mike Bayer wrote: On 4/20/15 8:09 AM, Guido Winkelmann wrote: On MySQL/PostgreSQL, this line fails: Apparently

Re: [sqlalchemy] Non backwards-compatible changes in 1.0? Lots of suddenly failing tests here.

2015-04-21 Thread Guido Winkelmann
On Tuesday 21 April 2015 09:43:51 Mike Bayer wrote: On 4/21/15 6:45 AM, Guido Winkelmann wrote: On Monday 20 April 2015 21:57:40 Oliver Palmer wrote: [...] So I got to thinking about what we're doing differently with sqlite and this bit of code comes to mind: # sqlite specific

Re: [sqlalchemy] Non backwards-compatible changes in 1.0? Lots of suddenly failing tests here.

2015-04-21 Thread Guido Winkelmann
On Monday 20 April 2015 19:22:36 Mike Bayer wrote: On 4/20/15 12:56 PM, Guido Winkelmann wrote: I just tested, the problem is still present in the current master (bd61e7a3287079cf742f4df698bfe3628c090522 from github). Guido W. can you please try current master at least

Re: [sqlalchemy] Non backwards-compatible changes in 1.0? Lots of suddenly failing tests here.

2015-04-21 Thread Guido Winkelmann
On Monday 20 April 2015 21:57:40 Oliver Palmer wrote: [...] So I got to thinking about what we're doing differently with sqlite and this bit of code comes to mind: # sqlite specific configuration for development if db.engine.name == sqlite: @event.listens_for(Engine, connect)

[sqlalchemy] Non backwards-compatible changes in 1.0? Lots of suddenly failing tests here.

2015-04-20 Thread Guido Winkelmann
Hi, Have there been any non-backwards-compatible changes in SQLAlchemy 1.0 compared to 0.9.9? We are seeing a lot of sudden breakage in our unit tests when switching to SQLAlchemy 1.0 from 0.9.9. Tests that worked fine before suddenly fail across the board. Here's a an example of a test

Re: [sqlalchemy] Non backwards-compatible changes in 1.0? Lots of suddenly failing tests here.

2015-04-20 Thread Guido Winkelmann
On Monday 20 April 2015 11:23:06 Mike Bayer wrote: On 4/20/15 8:09 AM, Guido Winkelmann wrote: [...] On sqlite, drop_all() seems to fail to get the order of table drops right, and consequently runs into a referential integrity error. If you can post a reproducible issue, that's what I can work

Re: [sqlalchemy] Add an integer column as seconds to a datetime column in filter

2015-01-16 Thread Guido Winkelmann
([test]).where(test.c.finished_on + cast(‘1 sec’, INTERVAL) * test.c.wait func.NOW()) Guido Winkelmann gu...@ambient-entertainment.de javascript: wrote: Hi, How can I add one column containing integer values (NULL allowed), treating them as seconds, to another column from

[sqlalchemy] Add an integer column as seconds to a datetime column in filter

2015-01-15 Thread Guido Winkelmann
Hi, How can I add one column containing integer values (NULL allowed), treating them as seconds, to another column from the same table containing datetime values and compare the result to the current time? I have a table with a datetime column finished_on and in int column wait. Once wait

Re: [sqlalchemy] How to retry failed transactions?

2014-12-01 Thread Guido Winkelmann
On Friday 28 November 2014 16:38:47 Michael Bayer wrote: On Nov 28, 2014, at 9:28 AM, Guido Winkelmann gu...@ambient-entertainment.de wrote: [...] The problem is, in SQLAlchemy, at least with a PostgreSQL+psycopg2 backend, the exception I get when that happens is InvalidRequestError

[sqlalchemy] How to retry failed transactions?

2014-11-28 Thread Guido Winkelmann
Hi, What's the best strategy for retrying failed transactions when using SQLAlchemy? Sometimes, transactions fail on commit, through no fault of their own, simply because another concurrent but conflicting transaction finished slightly before them. The commonly accepted best practice seems

Re: [sqlalchemy] Compound unique constraint with a nullable column

2014-11-18 Thread Guido Winkelmann
On Monday 17 November 2014 14:44:02 Michael Bayer wrote: On Nov 17, 2014, at 1:55 PM, Guido Winkelmann gu...@ambient-entertainment.de wrote: Am Montag, 17. November 2014 16:25:54 UTC+1 schrieb Michael Bayer: On Nov 17, 2014, at 7:37 AM, Guido Winkelmann gu...@ambient-entertainment.de

[sqlalchemy] Compound unique constraint with a nullable column

2014-11-17 Thread Guido Winkelmann
Hi, How can I go about having a cross-platform compatible compound unique constraint over two columns where there can be only one record with NULL in one column and a given value in the other? I want something like this: UniqueConstraint(parent_id, name) except parent_id is nullable, and I

Re: [sqlalchemy] Compound unique constraint with a nullable column

2014-11-17 Thread Guido Winkelmann
Am Montag, 17. November 2014 16:25:54 UTC+1 schrieb Michael Bayer: On Nov 17, 2014, at 7:37 AM, Guido Winkelmann gu...@ambient-entertainment.de javascript: wrote: Hi, How can I go about having a cross-platform compatible compound unique constraint over two columns where there can

[sqlalchemy] Subquery giving single values in the SELECT part of a query

2014-10-22 Thread Guido Winkelmann
Hi, How can I put a subquery that yields exactly one value inside the select part of the query without joining the subquery like another table? I have a table jobs and a table tasks. Every job has got any arbitrary number (zero or more) of tasks. Tasks can be in one of four states: queued,

[sqlalchemy] How to tell the cardinality of RelationshipProperty?

2014-02-13 Thread Guido Winkelmann
Hi, Reading through the docs, I could not find out how to tell the cardinality of an object of type sqlalchemy.orm.properties.RelationshipProperty, i.e. whether it is one-to-many, many-to-one or many-to-many. Mostly, I just need to know whether a relationship refers to just one object or a

Re: [sqlalchemy] How to tell the cardinality of RelationshipProperty?

2014-02-13 Thread Guido Winkelmann
Am Donnerstag, 13. Februar 2014 15:46:31 UTC+1 schrieb Michael Bayer: On Feb 13, 2014, at 6:23 AM, Guido Winkelmann gu...@ambient-entertainment.de javascript: wrote: Hi, Reading through the docs, I could not find out how to tell the cardinality of an object of type

Re: [sqlalchemy] How to tell the cardinality of RelationshipProperty?

2014-02-13 Thread Guido Winkelmann
Am Donnerstag, 13. Februar 2014 18:01:27 UTC+1 schrieb Michael Bayer: On Feb 13, 2014, at 11:46 AM, Guido Winkelmann gu...@ambient-entertainment.de javascript: wrote: Am Donnerstag, 13. Februar 2014 15:46:31 UTC+1 schrieb Michael Bayer: On Feb 13, 2014, at 6:23 AM, Guido Winkelmann