Re: [sqlalchemy] SQLAlchemy JTI subqueryload bug

2017-06-15 Thread mike bayer
it's two bugs https://bitbucket.org/zzzeek/sqlalchemy/issues/4011/joined-subclass-to-2-level-subquery-load and reopened in master https://bitbucket.org/zzzeek/sqlalchemy/issues/3963/aliased-vs-non-aliased-specificity-in thanks! On 06/15/2017 01:23 AM, Sherwin Yu wrote: We found a bug

[sqlalchemy] SQLAlchemy JTI subqueryload bug

2017-06-14 Thread Sherwin Yu
We found a bug involving filtering a JTI relation and subqueryloading. The emitted SQL for the subqueryload does not correctly join the child and parent JTI tables, resulting in a cross product. Info: - psql (PostgreSQL) 9.5.7 - SQLAlchemy 0.9.10 Suppose we have the following relations

[sqlalchemy] Object Relational Tutorial bug

2017-04-25 Thread xela
Hi--- I set out about 20 minutes ago to learn SQLAlchemy, and the third hit Google gave me was the Object Relational Tutorial: http://docs.sqlalchemy.org/en/latest/orm/tutorial.html Where I stalled on the second sentence of the second paragraph, the intended meaning of which I cannot

Re: [sqlalchemy] Created edge-case bug with `contains_eager`, can't reproduce

2015-11-03 Thread Jonathan Vanasco
Ah ha! I figured this out. It was a mix of a lazy eye and some peculiarities between Postgres(live) and sqlite(test-case). Given the query: session.query(Foo).options(contains_eager('bar')).order_by(Foo.id.desc()).offset(0).limit(100).all()] The SQL is (approx) select foo.*, bar.*

Re: [sqlalchemy] Created edge-case bug with `contains_eager`, can't reproduce

2015-10-30 Thread Jonathan Vanasco
On Friday, October 30, 2015 at 11:38:50 AM UTC-4, Michael Bayer wrote: > you wouldn't typically want to specify contains_eager('bar') if the SQL > has no JOIN in it, which you'd do with query.join(). There's no valid reason for using the `contains_eager` here -- it's just a typo. I

Re: [sqlalchemy] Created edge-case bug with `contains_eager`, can't reproduce

2015-10-30 Thread Mike Bayer
On 10/29/15 7:54 PM, Jonathan Vanasco wrote: > > > The difference is between these 2 forms: > > [(f.id, f.bar_id) for f in > session.query(Foo).options(joinedload('bar')).order_by(Foo.id.desc()).offset(0).limit(100).all()] > [(f.id, f.bar_id) for f in >

[sqlalchemy] Created edge-case bug with `contains_eager`, can't reproduce

2015-10-29 Thread Jonathan Vanasco
I've spent an hour trying to reproduce this bug and can't. I'm hoping someone can suggest what might be going on so I can make this reproducable for a bug report I have 2 classes: class Foo(Base): __tablename__ = 'foo' id = Column(Integer, primary_key=True) bar_id

Re: [sqlalchemy] Created edge-case bug with `contains_eager`, can't reproduce

2015-10-29 Thread Mike Bayer
On 10/29/15 6:50 PM, Jonathan Vanasco wrote: > I've spent an hour trying to reproduce this bug and can't. I'm hoping > someone can suggest what might be going on so I can make this > reproducable for a bug report > > I have 2 classes: > > class Foo(Base): > __tablename__ = 'foo'

Re: [sqlalchemy] Created edge-case bug with `contains_eager`, can't reproduce

2015-10-29 Thread Jonathan Vanasco
On Thursday, October 29, 2015 at 7:33:47 PM UTC-4, Michael Bayer wrote: > > i dont have an immediate answer, though i wonder why you aren't using > ~Bar.is_x.is(True) for that "IS NOT"... > Old habits and styleguide. The `~` ended up being missed on too many glances and code-reviews. >

[sqlalchemy] Re: Re: Possible bug with views

2015-05-06 Thread Brecht Machiels
Hello Mike, On Tue, 05 May 2015 21:09:31 +0200, Mike Bayer mike...@zzzcomputing.com wrote: On 5/5/15 1:17 PM, Brecht Machiels wrote: Oops, was a bit too quick there... Here's the echo='debug' output: 2015-05-05 19:16:11,528 INFO sqlalchemy.engine.base.Engine SELECT * FROM group_counts

[sqlalchemy] CTE name quoting bug in 0.8

2013-08-13 Thread jtruscott
Hi, I updated sqlalchemy from 0.7.8 to 0.8.2 and one of my queries started failing. I had a CTE expression with capital letters in it's name, and in 0.8 it wasn't getting consistently quoted, but it worked in 0.7. I narrowed it down, and it only seems to happen in a query containing multiple

Re: [sqlalchemy] Is this a bug?(about Overriding Reflected Columns)

2011-04-01 Thread Michael Bayer
On Apr 1, 2011, at 1:12 AM, Inside Zhou wrote: Thank you for you answer,but I'm sorry,I don't quite follow you. My confusion is that with the s.query(User).all(),SA issues SQL stmt the same as user_table.select().execute(),but why the latter stmt can return the row what I expected

[sqlalchemy] Is this a bug?(about Overriding Reflected Columns)

2011-03-31 Thread Inside Zhou
First I try to create a table like this: user_table = Table('user', metadata, Column('id', Integer), Column('name', Unicode) ) then I discards the table in metadata and reload it by reflection with overriding: user_table = Table('user', metadata, Column('id', Integer,

Re: [sqlalchemy] Is this a bug?(about Overriding Reflected Columns)

2011-03-31 Thread Michael Bayer
On Mar 31, 2011, at 9:31 PM, Inside Zhou wrote: First I try to create a table like this: user_table = Table('user', metadata, Column('id', Integer), Column('name', Unicode) ) then I discards the table in metadata and reload it by reflection with overriding: user_table =

Re: [sqlalchemy] Is this a bug?(about Overriding Reflected Columns)

2011-03-31 Thread Inside Zhou
Thank you for you answer,but I'm sorry,I don't quite follow you. My confusion is that with the s.query(User).all(),SA issues SQL stmt the same as user_table.select().execute(),but why the latter stmt can return the row what I expected whereas the former couldn't? besides,the table in DB change

[sqlalchemy] [Postgres] possibly a bug?

2011-02-17 Thread Hayato ARAKI
Hi With sqlalchemy 0.7b1 and postgresql if you define a BigInteger type for a primarykey, the SQL generated for CREATE TABLE is a 'serial' and not a 'bigserial'. (I am generating the sql using pylons) I just started using sqlalchemy and not sure if this is a bug, but thought I should notice you.

Re: [sqlalchemy] [Postgres] possibly a bug?

2011-02-17 Thread Michael Bayer
yes that is a bug, a regression from 0.6 where you'll get BIGSERIAL. ticket # 2065 is added thanks for the report ! On Feb 17, 2011, at 6:35 AM, Hayato ARAKI wrote: Hi With sqlalchemy 0.7b1 and postgresql if you define a BigInteger type for a primarykey, the SQL generated for CREATE

[sqlalchemy] _dependency_processor Attribute Error Bug in orm.dependency with viewonly many to many relationships

2009-08-17 Thread chris e
I'm not sure if this affects S.A 0.6. It appears that orm.properties.RelationProperty. _post_init does not create a _dependency_processor attribute if the relation is viewonly. Line1016: if not self.viewonly: self._dependency_processor =

[sqlalchemy] Is this SQLAlchemy's bug? The result come differently from session's query and plain sql which built by session's query.

2009-03-16 Thread Alisue
SQLAlchemy: 0.5.2 SQLite: 3.5.9 MySQL: 5.0.67-0ubuntu6 To short. The problem is 'The result come differently from session's query and plain sql which built by session's query.' Well... It is too difficult to explain the situation so just have a look my code first please. subquery =

[sqlalchemy] Weird mapper() behaviour (bug?)

2009-03-02 Thread Karlo Lozovina
Hi guys! Here goes the code sample: from sqlalchemy import create_engine, MetaData from sqlalchemy import Table, Column, ForeignKey, Integer from sqlalchemy.orm import sessionmaker, mapper, relation metadata = MetaData() engine = create_engine('sqlite:///:memory:', echo=True) parent_table =

[sqlalchemy] Re: deferred column_property bug in 0.5.1?

2009-01-23 Thread Michael Bayer
Ive made an adjustment in r5720 such that _expire_state() will exclude unloaded, deferred attribute names from the list of attributes to expire. So deferreds won't load in that specific case. Otherwise, explicitly expiring the deferred attribute or expiring when the deferred attribute

[sqlalchemy] Re: Possible quoting bug, SQLite? If not, what wrong (please)?

2008-05-22 Thread Michael Bayer
label() is quoting isnull because isnull is listed as a reserved word. literal_column(isnull) is not, because literal_column does exactly what you say. So id try first not using the word isnull for the label. After that, its possible that SQlite isnt going to let you allow ordering by

[sqlalchemy] Re: Possible quoting bug, SQLite? If not, what wrong (please)?

2008-05-22 Thread andrew cooke
1 - changing isnull to foo worked. thanks! 2 - i tried adding text('nulls last') in the order_by(...), but got an error from sqlite. i don't suppose there's something clever in sqlalchemy that does this in a portable way is there? 3 - what do you use as a reference for SQL? do you have the

[sqlalchemy] Re: Possible quoting bug, SQLite? If not, what wrong (please)?

2008-05-22 Thread andrew cooke
the case solution works too, which is what i'll go with. thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from

[sqlalchemy] SQLite schema select bug?

2008-01-25 Thread Nick Joyce
Hi, I am developing a web app using SQLite (which I will switch to PostgreSQL in production) and came across a weird select error when using schema. The attached file test.py reproduces the error and output.txt is the output from running the script. I have tested with 0.4.2p3 and trunk r4097.

[sqlalchemy] Re: Object Init Bug?

2007-11-14 Thread Koen Bok
Yep. That was it. Stupid me... On Nov 13, 4:10 pm, Michael Bayer [EMAIL PROTECTED] wrote: On Nov 13, 2007, at 8:25 AM, Koen Bok wrote: Hi, I have this strange bug or problem... I have a basic class like this mapped to a table with the same name. Metatype is a relation to the metatype

[sqlalchemy] Re: Object Init Bug?

2007-11-13 Thread Michael Bayer
On Nov 13, 2007, at 8:25 AM, Koen Bok wrote: Hi, I have this strange bug or problem... I have a basic class like this mapped to a table with the same name. Metatype is a relation to the metatype object. class MetaData(DBObject): def __init__(self, metatype, value, item):

[sqlalchemy] Re: max/coalesce bug in 0.4?

2007-09-06 Thread Michael Bayer
all the default SQL functions are being executed inline here. so it doesnt like aggregates like max being placed into defaults like that. the best I can do for you here, other than rolling back the entire inilne default thing, would look like this: Column('foo', Integer,

[sqlalchemy] Re: max/coalesce bug in 0.4?

2007-09-06 Thread Koen Bok
Tried that, but it just places the select statement within the insert statement without brackets: 2007-09-06 18:00:57,603 INFO sqlalchemy.engine.base.Engine.0x..90 INSERT INTO request (id, metanumberstate) VALUES (%(id)s, SELECT coalesce(max(metanumber.id), %(coalesce)s) FROM metanumber)

[sqlalchemy] Re: max/coalesce bug in 0.4?

2007-09-06 Thread Michael Bayer
OK that one is fixed in r3467. On Sep 6, 2007, at 12:02 PM, Koen Bok wrote: Tried that, but it just places the select statement within the insert statement without brackets: 2007-09-06 18:00:57,603 INFO sqlalchemy.engine.base.Engine.0x..90 INSERT INTO request (id, metanumberstate) VALUES

[sqlalchemy] Is this a bug?

2007-05-23 Thread Randall Smith
This is the error: Note that the first param is an SA object instead of the integer key. sqlalchemy.exceptions.SQLError: (ProgrammingError) can't adapt 'SELECT records_tinwsys.tinwsys_st_code AS records_tinwsys_tinwsys_st_code, records_tinwsys.tinwsys_is_number AS

[sqlalchemy] UOW relation delete bug

2007-03-27 Thread Rick Morrison
Surprised no one has hit this one yet. When issuing a series of deletes in a UOW, SA issues the bogus delete statement DELETE child where id = [1,2,3] instead of using IN() Test case attached. Seems to work in Sqlite even while issuing the bogus SQL (which is probably why a unit test