Skip to content

Commit

Permalink
Revert "changing drivers to support hive, presto and trino with sqlal…
Browse files Browse the repository at this point in the history
…chemy>=2.0 (#448)"

This reverts commit b0206d3.
  • Loading branch information
bkyryliuk authored May 17, 2023
1 parent b0206d3 commit 5f8c0a3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 23 deletions.
14 changes: 3 additions & 11 deletions pyhive/sqlalchemy_hive.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 2 additions & 6 deletions pyhive/sqlalchemy_presto.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
8 changes: 2 additions & 6 deletions pyhive/sqlalchemy_trino.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit 5f8c0a3

Please sign in to comment.