File tree Expand file tree Collapse file tree 3 files changed +23
-7
lines changed Expand file tree Collapse file tree 3 files changed +23
-7
lines changed Original file line number Diff line number Diff line change 1313
1414import re
1515from sqlalchemy import exc
16- from sqlalchemy import processors
16+ try :
17+ from sqlalchemy import processors
18+ except ImportError :
19+ # Newer versions of sqlalchemy require:
20+ from sqlalchemy .engine import processors
1721from sqlalchemy import types
1822from sqlalchemy import util
1923# TODO shouldn't use mysql type
20- from sqlalchemy .databases import mysql
24+ try :
25+ from sqlalchemy .databases .mysql import MSTinyInteger
26+ except ImportError :
27+ # Newer versions of sqlalchemy require:
28+ from sqlalchemy .dialects .mysql import MSTinyInteger
2129from sqlalchemy .engine import default
2230from sqlalchemy .sql import compiler
2331from sqlalchemy .sql .compiler import SQLCompiler
@@ -121,7 +129,7 @@ def __init__(self, dialect):
121129
122130_type_map = {
123131 'boolean' : types .Boolean ,
124- 'tinyint' : mysql . MSTinyInteger ,
132+ 'tinyint' : MSTinyInteger ,
125133 'smallint' : types .SmallInteger ,
126134 'int' : types .Integer ,
127135 'bigint' : types .BigInteger ,
Original file line number Diff line number Diff line change 1313from sqlalchemy import types
1414from sqlalchemy import util
1515# TODO shouldn't use mysql type
16- from sqlalchemy .databases import mysql
16+ try :
17+ from sqlalchemy .databases .mysql import MSTinyInteger
18+ except ImportError :
19+ # Newer versions of sqlalchemy require:
20+ from sqlalchemy .dialects .mysql import MSTinyInteger
1721from sqlalchemy .engine import default
1822from sqlalchemy .sql import compiler
1923from sqlalchemy .sql .compiler import SQLCompiler
@@ -29,7 +33,7 @@ class PrestoIdentifierPreparer(compiler.IdentifierPreparer):
2933
3034_type_map = {
3135 'boolean' : types .Boolean ,
32- 'tinyint' : mysql . MSTinyInteger ,
36+ 'tinyint' : MSTinyInteger ,
3337 'smallint' : types .SmallInteger ,
3438 'integer' : types .Integer ,
3539 'bigint' : types .BigInteger ,
Original file line number Diff line number Diff line change 1313from sqlalchemy import types
1414from sqlalchemy import util
1515# TODO shouldn't use mysql type
16- from sqlalchemy .databases import mysql
16+ try :
17+ from sqlalchemy .databases .mysql import MSTinyInteger
18+ except ImportError :
19+ # Newer versions of sqlalchemy require:
20+ from sqlalchemy .dialects .mysql import MSTinyInteger
1721from sqlalchemy .engine import default
1822from sqlalchemy .sql import compiler
1923from sqlalchemy .sql .compiler import SQLCompiler
@@ -28,7 +32,7 @@ class TrinoIdentifierPreparer(PrestoIdentifierPreparer):
2832
2933_type_map = {
3034 'boolean' : types .Boolean ,
31- 'tinyint' : mysql . MSTinyInteger ,
35+ 'tinyint' : MSTinyInteger ,
3236 'smallint' : types .SmallInteger ,
3337 'integer' : types .Integer ,
3438 'bigint' : types .BigInteger ,
You can’t perform that action at this time.
0 commit comments