- attached sqlitetest.py
RowProxy does not correctly name aggregate columns under Sqlite
Issue #459
resolved
The keys and attributes for columns that are the result of an aggregate function are not mapped properly under Sqlite.
In postgres, when calling keys() on a row of the result set, a column aggregated with the MAX() function returns a column key of 'max'. Under Sqlite keys() will return 'somerow)' as the column name. Attribute access to the column also fails.
I have attached a test program that demonstrates the error. It appears when using SQLAchemy 0.3.4, with Sqlite 3.3.3 and psycopg 2.0.5.1.
Comments (4)
-
Account Deleted -
repo owner - marked as minor
this is a SQLite issue. the workaround is to use a label for your column:
stmt = select([func.max(testable.c.val).label('myfunc')](func.max(testable.c.val).label('myfunc')))
-
repo owner - changed status to wontfix
-
repo owner - removed milestone
Removing milestone: 0.3.4 (automated comment)
- Log in to comment
test demonstrating Sqlite aggregate column bug