aio-libs / aio-libs/aiomysql

SQLAlchemy 1.4 statements with .in_ operator not compiled correctly

Open
#577 5 comments 0 reactions 0 assignees View on GitHub
bug sqlalchemy
Dominant language
Python
Stars
1.9k
Forks
272
PR merge metrics
No merged PRs in 30d

Description

In SQLAlchemy version 1.4 they way statements using the `.in_` operator are compiled was changed to enable better caching. However this means statements need to be compiled with additional compile args in order to render correctly. You can read about the change here:
https://docs.sqlalchemy.org/en/14/changelog/migration_14.html#change-4645

The issue this manifests itself as:
```python3
stmt = select([my_table]).where(my_table.c.column.in_([1, 2]))

async with database.acquire() as conn:
result = await conn.execute(stmt)

pymysql.err.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[POSTCOMPILE_column_1])
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.