Skip to content

Commit

Permalink
Fix SQLAlchemy 1.2.0 compatibility (#411) (#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gr1N authored and jettify committed Jan 3, 2018
1 parent 83d9714 commit 552e0a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion aiopg/sa/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 552e0a8

Please sign in to comment.