13
13
import sqlalchemy as sqla
14
14
from sqlalchemy .sql import and_ , or_ , not_
15
15
16
+ from tests .unit .conftest import sqlalchemy_version
16
17
from trino .sqlalchemy .datatype import JSON
17
18
18
19
@@ -24,6 +25,10 @@ def trino_connection(run_trino, request):
24
25
yield engine , engine .connect ()
25
26
26
27
28
+ @pytest .mark .skipif (
29
+ sqlalchemy_version () < "1.4" ,
30
+ reason = "columns argument to select() must be a Python list or other iterable"
31
+ )
27
32
@pytest .mark .parametrize ('trino_connection' , ['tpch' ], indirect = True )
28
33
def test_select_query (trino_connection ):
29
34
_ , conn = trino_connection
@@ -49,6 +54,10 @@ def assert_column(table, column_name, column_type):
49
54
assert isinstance (getattr (table .c , column_name ).type , column_type )
50
55
51
56
57
+ @pytest .mark .skipif (
58
+ sqlalchemy_version () < "1.4" ,
59
+ reason = "columns argument to select() must be a Python list or other iterable"
60
+ )
52
61
@pytest .mark .parametrize ('trino_connection' , ['system' ], indirect = True )
53
62
def test_select_specific_columns (trino_connection ):
54
63
_ , conn = trino_connection
@@ -65,6 +74,10 @@ def test_select_specific_columns(trino_connection):
65
74
assert isinstance (row ['state' ], str )
66
75
67
76
77
+ @pytest .mark .skipif (
78
+ sqlalchemy_version () < "1.4" ,
79
+ reason = "columns argument to select() must be a Python list or other iterable"
80
+ )
68
81
@pytest .mark .parametrize ('trino_connection' , ['memory' ], indirect = True )
69
82
def test_define_and_create_table (trino_connection ):
70
83
engine , conn = trino_connection
@@ -88,6 +101,10 @@ def test_define_and_create_table(trino_connection):
88
101
metadata .drop_all (engine )
89
102
90
103
104
+ @pytest .mark .skipif (
105
+ sqlalchemy_version () < "1.4" ,
106
+ reason = "columns argument to select() must be a Python list or other iterable"
107
+ )
91
108
@pytest .mark .parametrize ('trino_connection' , ['memory' ], indirect = True )
92
109
def test_insert (trino_connection ):
93
110
engine , conn = trino_connection
@@ -114,6 +131,10 @@ def test_insert(trino_connection):
114
131
metadata .drop_all (engine )
115
132
116
133
134
+ @pytest .mark .skipif (
135
+ sqlalchemy_version () < "1.4" ,
136
+ reason = "columns argument to select() must be a Python list or other iterable"
137
+ )
117
138
@pytest .mark .parametrize ('trino_connection' , ['memory' ], indirect = True )
118
139
def test_insert_multiple_statements (trino_connection ):
119
140
engine , conn = trino_connection
@@ -145,6 +166,10 @@ def test_insert_multiple_statements(trino_connection):
145
166
metadata .drop_all (engine )
146
167
147
168
169
+ @pytest .mark .skipif (
170
+ sqlalchemy_version () < "1.4" ,
171
+ reason = "columns argument to select() must be a Python list or other iterable"
172
+ )
148
173
@pytest .mark .parametrize ('trino_connection' , ['tpch' ], indirect = True )
149
174
def test_operators (trino_connection ):
150
175
_ , conn = trino_connection
@@ -161,6 +186,10 @@ def test_operators(trino_connection):
161
186
assert isinstance (row ['comment' ], str )
162
187
163
188
189
+ @pytest .mark .skipif (
190
+ sqlalchemy_version () < "1.4" ,
191
+ reason = "columns argument to select() must be a Python list or other iterable"
192
+ )
164
193
@pytest .mark .parametrize ('trino_connection' , ['tpch' ], indirect = True )
165
194
def test_conjunctions (trino_connection ):
166
195
_ , conn = trino_connection
@@ -197,6 +226,10 @@ def test_textual_sql(trino_connection):
197
226
assert isinstance (row ['comment' ], str )
198
227
199
228
229
+ @pytest .mark .skipif (
230
+ sqlalchemy_version () < "1.4" ,
231
+ reason = "columns argument to select() must be a Python list or other iterable"
232
+ )
200
233
@pytest .mark .parametrize ('trino_connection' , ['tpch' ], indirect = True )
201
234
def test_alias (trino_connection ):
202
235
_ , conn = trino_connection
@@ -216,6 +249,10 @@ def test_alias(trino_connection):
216
249
assert len (rows ) == 5
217
250
218
251
252
+ @pytest .mark .skipif (
253
+ sqlalchemy_version () < "1.4" ,
254
+ reason = "columns argument to select() must be a Python list or other iterable"
255
+ )
219
256
@pytest .mark .parametrize ('trino_connection' , ['tpch' ], indirect = True )
220
257
def test_subquery (trino_connection ):
221
258
_ , conn = trino_connection
@@ -230,6 +267,10 @@ def test_subquery(trino_connection):
230
267
assert len (rows ) == 15
231
268
232
269
270
+ @pytest .mark .skipif (
271
+ sqlalchemy_version () < "1.4" ,
272
+ reason = "columns argument to select() must be a Python list or other iterable"
273
+ )
233
274
@pytest .mark .parametrize ('trino_connection' , ['tpch' ], indirect = True )
234
275
def test_joins (trino_connection ):
235
276
_ , conn = trino_connection
@@ -245,6 +286,10 @@ def test_joins(trino_connection):
245
286
assert len (rows ) == 15
246
287
247
288
289
+ @pytest .mark .skipif (
290
+ sqlalchemy_version () < "1.4" ,
291
+ reason = "columns argument to select() must be a Python list or other iterable"
292
+ )
248
293
@pytest .mark .parametrize ('trino_connection' , ['tpch' ], indirect = True )
249
294
def test_cte (trino_connection ):
250
295
_ , conn = trino_connection
@@ -259,6 +304,10 @@ def test_cte(trino_connection):
259
304
assert len (rows ) == 15
260
305
261
306
307
+ @pytest .mark .skipif (
308
+ sqlalchemy_version () < "1.4" ,
309
+ reason = "columns argument to select() must be a Python list or other iterable"
310
+ )
262
311
@pytest .mark .parametrize (
263
312
'trino_connection,json_object' ,
264
313
[
0 commit comments