aio-libs / aiopg

aiopg is a library for accessing a PostgreSQL database from the asyncio
http://aiopg.readthedocs.io
BSD 2-Clause "Simplified" License
1.4k stars 160 forks source link

Incompatibility with SQLAlchemy 1.4 #869

Closed decaz closed 3 years ago

decaz commented 3 years ago

Describe the bug

AttributeError: module 'sqlalchemy.sql.expression' has no attribute '_string_or_unprintable' is raising here: https://github.com/aio-libs/aiopg/blob/10071ff27b4bc4560c61cd183534587cb24f586b/aiopg/sa/result.py#L201

To Reproduce

Call undefined column on row.

Expected behavior

Exception NoSuchColumnError is raised.

Logs/tracebacks

...
  File "/home/decaz/workspace/project/.venv/lib/python3.9/site-packages/aiopg/sa/result.py", line 55, in __getattr__                                                                                   
    return self[name]                                                                                                                                                                                             
  File "/home/decaz/workspace/project/.venv/lib/python3.9/site-packages/aiopg/sa/result.py", line 29, in __getitem__                                                                                   
    processor, obj, index = self._result_proxy._key_fallback(key)                                                                                                                                                 
  File "/home/decaz/workspace/project/.venv/lib/python3.9/site-packages/aiopg/sa/result.py", line 201, in _key_fallback                                                                                
    f"{expression._string_or_unprintable(key)!r}"                                                                                                                                                                 
AttributeError: module 'sqlalchemy.sql.expression' has no attribute '_string_or_unprintable'

Python Version

3.9.6

aiopg Version

1.3.1

OS

Linux

Additional context

No response

Code of Conduct