yeah, I have good news to report on this issue.   What you're seeing is not 
quite a regression from 0.7 to 0.8, it's an error that occurs in 0.8 as it is 
more strict about "ambiguous" columns - where in 0.7 the result of the two 
same-named columns would be that one just gets ignored, in 0.8 it labels both 
columns as ambiguous.   During beta testing, nobody reported this to me, but 
literally just this week someone posted it on StackOverflow which you can see 
here:  
http://stackoverflow.com/questions/15924689/invalidrequesterror-ambiguous-column-name-in-result-set-while-the-reques/15938036

I knew I had seen this issue years ago, and I'm not sure what we did with it 
then, but clearly more had to be done, so really I just finished it up 
yesterday here: http://www.sqlalchemy.org/trac/ticket/2702 where I've enhanced 
the "apply_labels" functionality of select() to ensure that any dupe labels get 
pushed out to be totally anonymized - that way the ORM can get to all the 
column values distinctly and correctly, since it targets the columns in the 
result using the original Column object (doesn't need to know those names 
directly).

This is a really major issue so I'd like to get 0.8.1 right out the door within 
a week hopefully. If you download the latest default, the issue should be 
fixed, and let me know if you can test for me that everything is OK.

Additionally, without the benefit of 0.8.1, the immediate workaround is to 
produce an alias of at least one of the classes:

ft_alias = alised(FooType)
query(Foo, ft_alias).filter(Foo.id == ft_alias.id)...


let me know how it goes.






On Apr 12, 2013, at 2:39 PM, Daniel Grace <[email protected]> wrote:

> I don't know how I managed to mangle that and thought I proofread my post, 
> but that second bit should have read:
> 
> "session.query(Foo, FooType) doesn't work, since the label generation aliases 
> both "foo.type_id" and "foo_type.id" to "foo_type_id" and thus causes an 
> exception similar to :" ...
> 
> -- 
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to