diff --git a/aiopg/sa/result.py b/aiopg/sa/result.py index 1e47c4cb..f3106d14 100644 --- a/aiopg/sa/result.py +++ b/aiopg/sa/result.py @@ -100,7 +100,12 @@ def __init__(self, result_proxy, metadata): self._keymap = keymap = {} self.keys = [] dialect = result_proxy.dialect - typemap = dialect.dbapi_type_map + + # `dbapi_type_map` property removed in SQLAlchemy 1.2+. + # Usage of `getattr` only needed for backward compatibility with + # older versions of SQLAlchemy. + typemap = getattr(dialect, 'dbapi_type_map', {}) + assert dialect.case_sensitive, \ "Doesn't support case insensitive database connection" diff --git a/requirements.txt b/requirements.txt index 2e89ed2b..940acdb5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,5 +11,5 @@ pytest-cov==2.5.1 pytest-sugar==0.9.0 pytest-timeout==1.2.1 sphinxcontrib-asyncio==0.2.0 -sqlalchemy==1.1.15 +sqlalchemy==1.2.0 psycopg2==2.6.2