Re: [sqlalchemy] NoSuchColumnError and _key_fallback

2013-10-11 Thread Michael Bayer
Redshift has all kinds of limitations and weird behaviors. They developed it as a simplified cloud db only generally based off of Postgres. Sent from my iPhone On Oct 10, 2013, at 11:11 PM, Wu Jiang wujian...@gmail.com wrote: Yes. Thank you, Michael. Still wondering why Redshift is case

[sqlalchemy] NoSuchColumnError and _key_fallback

2013-10-10 Thread Ryan Kelly
Hi: One of our applications is generating the following error: NoSuchColumnError: Could not locate column in row for column 'client.claims.client_id' Which is rather strange, because that column is aliased with .label() to AS Client_ID, so of course that row cannot be located. The exception

Re: [sqlalchemy] NoSuchColumnError and _key_fallback

2013-10-10 Thread Michael Bayer
On Oct 10, 2013, at 8:34 AM, Ryan Kelly rpkell...@gmail.com wrote: Hi: One of our applications is generating the following error: NoSuchColumnError: Could not locate column in row for column 'client.claims.client_id' Which is rather strange, because that column is aliased with

Re: [sqlalchemy] NoSuchColumnError and _key_fallback

2013-10-10 Thread Michael Bayer
Here's a rudimentary test which has Client_ID and client_id at the same time in the query. It renders as: SELECT a.client_id AS Client_ID, a.id AS a_id, a.client_id AS a_client_id FROM a the SQL being generated on your end is key here. from sqlalchemy import * from sqlalchemy.orm import *

Re: [sqlalchemy] NoSuchColumnError and _key_fallback

2013-10-10 Thread Ryan Kelly
On Thu, Oct 10/10/13, 2013 at 12:59:31PM -0400, Michael Bayer wrote: On Oct 10, 2013, at 8:34 AM, Ryan Kelly rpkell...@gmail.com wrote: Hi: One of our applications is generating the following error: NoSuchColumnError: Could not locate column in row for column

Re: [sqlalchemy] NoSuchColumnError and _key_fallback

2013-10-10 Thread Wu Jiang
It seems to only happen when we connect to Amazon Redshift. According to Redshift doc (http://docs.aws.amazon.com/redshift/latest/dg/r_names.html), delimited identifiers are case insensitive. On Thursday, October 10, 2013 2:06:09 PM UTC-4, Michael Bayer wrote: can you produce a test case?

Re: [sqlalchemy] NoSuchColumnError and _key_fallback

2013-10-10 Thread Michael Bayer
so send case_insensitive=True to create_engine() , all the result-row targeting will be done case insensitively - fixes the issue ? On Oct 10, 2013, at 4:46 PM, Wu Jiang wujian...@gmail.com wrote: It seems to only happen when we connect to Amazon Redshift. According to Redshift doc

Re: [sqlalchemy] NoSuchColumnError and _key_fallback

2013-10-10 Thread Wu Jiang
Yes. Thank you, Michael. Still wondering why Redshift is case insensitive. On Thursday, October 10, 2013 5:22:23 PM UTC-4, Michael Bayer wrote: so send case_insensitive=True to create_engine() , all the result-row targeting will be done case insensitively - fixes the issue ? On Oct 10,