Re: [sqlalchemy] 0.8 - `q.filter(None)` used to do nothing, now generates "WHERE NULL"

2016-04-28 Thread Jonathan Vanasco

On Wednesday, April 27, 2016 at 5:46:11 PM UTC-4, kevin...@chownow.com 
wrote:
>
> Thank you again for all your hard work on SQLAlchemy. It's incredibly 
> useful. I'm pleasantly surprised by how few things broke when we moved from 
> SQLAlchemy 0.7.9 to the 1.0.12.
>

FYI, something that WILL break on that migration is 'pagination' (ie, using 
limit/offset) with joinedloads if you do not have a fully deterministic 
column used for sorting in the "where" clause.

A new default was introduced in .9 (and backported to .8 for optional 
support) that adds a "distinct" clause to an inner query in the 
subqueryload.  If you don't have a fully deterministic where clause, the 
first few "pages" will appear to be fine BUT the latter pages will likely 
generate lots of errors from missing objects.

It's described in this note somewhat differently:
http://docs.sqlalchemy.org/en/latest/changelog/migration_09.html#subquery-eager-loading-will-apply-distinct-to-the-innermost-select-for-some-queries

I've been working on a changelog fix to make this more clear.

Because this is usually only apparent towards the latter "pages", most 
people (and tests) will miss it.  We had this bug in production for months 
without it being triggered.

The behavior until the .7 branch, combined with default natural sort orders 
on most backends, allowed "insufficient" queries to work.

I would just check your code to make sure any calls to subqueryload have a 
fully deterministic column.

-- 
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 https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


[sqlalchemy] Re: history_meta

2016-04-28 Thread Jonathan Vanasco
There are a lot of ways to handle versioning in SqlAlchemy.  This is just 
one example.  The docs show another approach as well 
(http://docs.sqlalchemy.org/en/latest/orm/examples.html#versioning-objects)

It's not included, because it's just an example.  It won't suit all cases 
and many people will want to adapt.

Unlike most other db packages, SqlAlchemy is not opinionated and doesn't 
force an approach.  One of my projects has 3 types of versioning, depending 
on the content type and business needs.  

If you want a full-fledged versioning system, there are a few plugins and 
projects on PyPi.  One I recall offhand is "sqlalchemy-continuum"


-- 
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 https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] unable to use SQLAlchemy with python2.7

2016-04-28 Thread Jonathan Vanasco
You have to install the python packages for each environment with their 
version of pip or easy_install.

-- 
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 https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


[sqlalchemy] history_meta

2016-04-28 Thread Nicholas Cole
I'm looking to create version tables for my objects.

Is the history_meta.py example suitable for production use?  Is there any 
reason that it isn't included in the actual sqlalchemy library rather than 
being kept separate as an 'example'?

Best wishes,

Nicholas

-- 
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 https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] unable to use SQLAlchemy with python2.7

2016-04-28 Thread Simon King
On Thu, Apr 28, 2016 at 11:45 AM, Rahul Raghunath 
wrote:

> I'm currently running python 3.5. SQLAlchemy works perfectly well well
> with it.
> How ever, i wish to now use it with python 2.7, which is also installed on
> my computer because the other compnents, such as http.server, are easier to
> use with python 2.7.
>
> I'm having a hard time figuring out how to use SQLAlchemy across both
> python versions. Any suggestion?
>
> What exactly are you having a problem with? SQLAlchemy works fine on
python 2.7.

Simon

-- 
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 https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


[sqlalchemy] unable to use SQLAlchemy with python2.7

2016-04-28 Thread Rahul Raghunath
I'm currently running python 3.5. SQLAlchemy works perfectly well well with 
it.
How ever, i wish to now use it with python 2.7, which is also installed on 
my computer because the other compnents, such as http.server, are easier to 
use with python 2.7.

I'm having a hard time figuring out how to use SQLAlchemy across both 
python versions. Any suggestion?

-- 
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 https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


Re: [sqlalchemy] Bug in BufferedColumnResultProxy class?

2016-04-28 Thread Piotr Dobrogost
On Wednesday, April 27, 2016 at 6:41:24 PM UTC+2, Mike Bayer wrote:
>
>
>
> On 04/27/2016 11:11 AM, Mike Bayer wrote: 
> > 
> > I'm improving our test suite by ensuring that result processors are 
> > fired off for all result proxy subtypes when caching is used as well and 
> > I will ensure the line of code you mention is exercised.  If I can 
> > reproduce your described issue at that level, then the bug will be 
> > located and fixed.   I'll keep you posted. 
> > 
>
> with query caching enabled the issue is reproduced with new test cases, 
> a fix for the issue is in review via the link at 
>
> https://bitbucket.org/zzzeek/sqlalchemy/issues/3699/buffferedcolumnresultproxy-with.
>  
>
>

I would like to thank you Mike very much for your assistance, perseverance, 
invaluable help and the fix.
Your support is exemplar.

Best regards from users of your excellent SQLAlchemy,
Marcin Raczyński i Piotr Dobrogost from Poland

ps.
The original investigation of the issue and suggested fix was done by 
Marcin Raczyński.

-- 
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 https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.