1313import sqlalchemy as sqla
1414from sqlalchemy .sql import and_ , or_ , not_
1515
16+ from tests .unit .conftest import sqlalchemy_version
1617from trino .sqlalchemy .datatype import JSON
1718
1819
@@ -24,6 +25,10 @@ def trino_connection(run_trino, request):
2425 yield engine , engine .connect ()
2526
2627
28+ @pytest .mark .skipif (
29+ sqlalchemy_version () < "1.4" ,
30+ reason = "columns argument to select() must be a Python list or other iterable"
31+ )
2732@pytest .mark .parametrize ('trino_connection' , ['tpch' ], indirect = True )
2833def test_select_query (trino_connection ):
2934 _ , conn = trino_connection
@@ -49,6 +54,10 @@ def assert_column(table, column_name, column_type):
4954 assert isinstance (getattr (table .c , column_name ).type , column_type )
5055
5156
57+ @pytest .mark .skipif (
58+ sqlalchemy_version () < "1.4" ,
59+ reason = "columns argument to select() must be a Python list or other iterable"
60+ )
5261@pytest .mark .parametrize ('trino_connection' , ['system' ], indirect = True )
5362def test_select_specific_columns (trino_connection ):
5463 _ , conn = trino_connection
@@ -65,6 +74,10 @@ def test_select_specific_columns(trino_connection):
6574 assert isinstance (row ['state' ], str )
6675
6776
77+ @pytest .mark .skipif (
78+ sqlalchemy_version () < "1.4" ,
79+ reason = "columns argument to select() must be a Python list or other iterable"
80+ )
6881@pytest .mark .parametrize ('trino_connection' , ['memory' ], indirect = True )
6982def test_define_and_create_table (trino_connection ):
7083 engine , conn = trino_connection
@@ -88,6 +101,10 @@ def test_define_and_create_table(trino_connection):
88101 metadata .drop_all (engine )
89102
90103
104+ @pytest .mark .skipif (
105+ sqlalchemy_version () < "1.4" ,
106+ reason = "columns argument to select() must be a Python list or other iterable"
107+ )
91108@pytest .mark .parametrize ('trino_connection' , ['memory' ], indirect = True )
92109def test_insert (trino_connection ):
93110 engine , conn = trino_connection
@@ -114,6 +131,10 @@ def test_insert(trino_connection):
114131 metadata .drop_all (engine )
115132
116133
134+ @pytest .mark .skipif (
135+ sqlalchemy_version () < "1.4" ,
136+ reason = "columns argument to select() must be a Python list or other iterable"
137+ )
117138@pytest .mark .parametrize ('trino_connection' , ['memory' ], indirect = True )
118139def test_insert_multiple_statements (trino_connection ):
119140 engine , conn = trino_connection
@@ -145,6 +166,10 @@ def test_insert_multiple_statements(trino_connection):
145166 metadata .drop_all (engine )
146167
147168
169+ @pytest .mark .skipif (
170+ sqlalchemy_version () < "1.4" ,
171+ reason = "columns argument to select() must be a Python list or other iterable"
172+ )
148173@pytest .mark .parametrize ('trino_connection' , ['tpch' ], indirect = True )
149174def test_operators (trino_connection ):
150175 _ , conn = trino_connection
@@ -161,6 +186,10 @@ def test_operators(trino_connection):
161186 assert isinstance (row ['comment' ], str )
162187
163188
189+ @pytest .mark .skipif (
190+ sqlalchemy_version () < "1.4" ,
191+ reason = "columns argument to select() must be a Python list or other iterable"
192+ )
164193@pytest .mark .parametrize ('trino_connection' , ['tpch' ], indirect = True )
165194def test_conjunctions (trino_connection ):
166195 _ , conn = trino_connection
@@ -197,6 +226,10 @@ def test_textual_sql(trino_connection):
197226 assert isinstance (row ['comment' ], str )
198227
199228
229+ @pytest .mark .skipif (
230+ sqlalchemy_version () < "1.4" ,
231+ reason = "columns argument to select() must be a Python list or other iterable"
232+ )
200233@pytest .mark .parametrize ('trino_connection' , ['tpch' ], indirect = True )
201234def test_alias (trino_connection ):
202235 _ , conn = trino_connection
@@ -216,6 +249,10 @@ def test_alias(trino_connection):
216249 assert len (rows ) == 5
217250
218251
252+ @pytest .mark .skipif (
253+ sqlalchemy_version () < "1.4" ,
254+ reason = "columns argument to select() must be a Python list or other iterable"
255+ )
219256@pytest .mark .parametrize ('trino_connection' , ['tpch' ], indirect = True )
220257def test_subquery (trino_connection ):
221258 _ , conn = trino_connection
@@ -230,6 +267,10 @@ def test_subquery(trino_connection):
230267 assert len (rows ) == 15
231268
232269
270+ @pytest .mark .skipif (
271+ sqlalchemy_version () < "1.4" ,
272+ reason = "columns argument to select() must be a Python list or other iterable"
273+ )
233274@pytest .mark .parametrize ('trino_connection' , ['tpch' ], indirect = True )
234275def test_joins (trino_connection ):
235276 _ , conn = trino_connection
@@ -245,6 +286,10 @@ def test_joins(trino_connection):
245286 assert len (rows ) == 15
246287
247288
289+ @pytest .mark .skipif (
290+ sqlalchemy_version () < "1.4" ,
291+ reason = "columns argument to select() must be a Python list or other iterable"
292+ )
248293@pytest .mark .parametrize ('trino_connection' , ['tpch' ], indirect = True )
249294def test_cte (trino_connection ):
250295 _ , conn = trino_connection
@@ -259,6 +304,10 @@ def test_cte(trino_connection):
259304 assert len (rows ) == 15
260305
261306
307+ @pytest .mark .skipif (
308+ sqlalchemy_version () < "1.4" ,
309+ reason = "columns argument to select() must be a Python list or other iterable"
310+ )
262311@pytest .mark .parametrize (
263312 'trino_connection,json_object' ,
264313 [
0 commit comments