diff --git a/pyhive/sqlalchemy_hive.py b/pyhive/sqlalchemy_hive.py index 34fdb648..f39f1793 100644 --- a/pyhive/sqlalchemy_hive.py +++ b/pyhive/sqlalchemy_hive.py @@ -13,19 +13,11 @@ import re from sqlalchemy import exc -try: - from sqlalchemy import processors -except ImportError: - # Newer versions of sqlalchemy require: - from sqlalchemy.engine import processors +from sqlalchemy import processors from sqlalchemy import types from sqlalchemy import util # TODO shouldn't use mysql type -try: - from sqlalchemy.databases.mysql import MSTinyInteger -except ImportError: - # Newer versions of sqlalchemy require: - from sqlalchemy.dialects.mysql import MSTinyInteger +from sqlalchemy.databases import mysql from sqlalchemy.engine import default from sqlalchemy.sql import compiler from sqlalchemy.sql.compiler import SQLCompiler @@ -129,7 +121,7 @@ def __init__(self, dialect): _type_map = { 'boolean': types.Boolean, - 'tinyint': MSTinyInteger, + 'tinyint': mysql.MSTinyInteger, 'smallint': types.SmallInteger, 'int': types.Integer, 'bigint': types.BigInteger, diff --git a/pyhive/sqlalchemy_presto.py b/pyhive/sqlalchemy_presto.py index 94d06412..a199ebe1 100644 --- a/pyhive/sqlalchemy_presto.py +++ b/pyhive/sqlalchemy_presto.py @@ -13,11 +13,7 @@ from sqlalchemy import types from sqlalchemy import util # TODO shouldn't use mysql type -try: - from sqlalchemy.databases.mysql import MSTinyInteger -except ImportError: - # Newer versions of sqlalchemy require: - from sqlalchemy.dialects.mysql import MSTinyInteger +from sqlalchemy.databases import mysql from sqlalchemy.engine import default from sqlalchemy.sql import compiler from sqlalchemy.sql.compiler import SQLCompiler @@ -33,7 +29,7 @@ class PrestoIdentifierPreparer(compiler.IdentifierPreparer): _type_map = { 'boolean': types.Boolean, - 'tinyint': MSTinyInteger, + 'tinyint': mysql.MSTinyInteger, 'smallint': types.SmallInteger, 'integer': types.Integer, 'bigint': types.BigInteger, diff --git a/pyhive/sqlalchemy_trino.py b/pyhive/sqlalchemy_trino.py index 686a42c7..4b2b3698 100644 --- a/pyhive/sqlalchemy_trino.py +++ b/pyhive/sqlalchemy_trino.py @@ -13,11 +13,7 @@ from sqlalchemy import types from sqlalchemy import util # TODO shouldn't use mysql type -try: - from sqlalchemy.databases.mysql import MSTinyInteger -except ImportError: - # Newer versions of sqlalchemy require: - from sqlalchemy.dialects.mysql import MSTinyInteger +from sqlalchemy.databases import mysql from sqlalchemy.engine import default from sqlalchemy.sql import compiler from sqlalchemy.sql.compiler import SQLCompiler @@ -32,7 +28,7 @@ class TrinoIdentifierPreparer(PrestoIdentifierPreparer): _type_map = { 'boolean': types.Boolean, - 'tinyint': MSTinyInteger, + 'tinyint': mysql.MSTinyInteger, 'smallint': types.SmallInteger, 'integer': types.Integer, 'bigint': types.BigInteger,