Skip to content

Commit 2be7e0f

Browse files
committed
Fix SQLAlchemy 1.2.0 compatibility (#411)
1 parent 83d9714 commit 2be7e0f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Diff for: aiopg/sa/result.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,12 @@ def __init__(self, result_proxy, metadata):
100100
self._keymap = keymap = {}
101101
self.keys = []
102102
dialect = result_proxy.dialect
103-
typemap = dialect.dbapi_type_map
103+
104+
# `dbapi_type_map` property removed in SQLAlchemy 1.2+.
105+
# Usage of `getattr` only needed for backward compatibility with
106+
# older versions of SQLAlchemy.
107+
typemap = getattr(dialect, 'dbapi_type_map', {})
108+
104109
assert dialect.case_sensitive, \
105110
"Doesn't support case insensitive database connection"
106111

Diff for: requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ pytest-cov==2.5.1
1111
pytest-sugar==0.9.0
1212
pytest-timeout==1.2.1
1313
sphinxcontrib-asyncio==0.2.0
14-
sqlalchemy==1.1.15
14+
sqlalchemy==1.2.0
1515
psycopg2==2.6.2

0 commit comments

Comments
 (0)