Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAWarning: Can't resolve label reference 'count_1 desc'; converting to text() #36

Closed
papachoco opened this issue Apr 16, 2015 · 1 comment

Comments

@papachoco
Copy link

SQLAlchemy 1.0.0 just got release. I observed the warning

SAWarning: Can't resolve label reference 'count_1 desc'; converting to text()

is thrown at dbapi.TahrirDatabase._make_leaderboard

It seems it does not cause any harm. but I wanted to make you aware

Carlos

@AdamWill
Copy link
Contributor

AdamWill commented Aug 9, 2019

A mere four years later, this breaks the world:

CompileError: Can't resolve label reference for ORDER BY / GROUP BY. Textual SQL expression 'count_1 desc' should be explicitly declared as text('count_1 desc')

seems to be with SQLAlchemy 1.3+ this is finally an error not a warning. I'll send a PR...

AdamWill added a commit to AdamWill/tahrir-api that referenced this issue Aug 9, 2019
laxathom added a commit that referenced this issue Aug 10, 2019
SQLAlchemy: explicitly declare order_by expression as text (#36)
laxathom pushed a commit that referenced this issue Aug 12, 2019
See: https://docs.sqlalchemy.org/en/13/changelog/migration_13.html#coercion-of-string-sql-fragments-to-text-fully-removed

This was a warning for years, but with 1.3 it's an error. If we
don't do this, the app blows up.

Signed-off-by: Adam Williamson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants