@@ -172,18 +172,16 @@ def test_insert_flat_data(self, cursor):
172172 def test_execute_select (self , superset_cursor ):
173173 superset_cursor .execute (
174174 """
175- SELECT col_list, A FROM (
176- SELECT col_list[1] col_list, NUMBER(col_map.A)
177- FROM %s WHERE key_partition='row_1'
178- )
175+ SELECT col_list[1] col_list, NUMBER(col_map.A)
176+ FROM %s WHERE key_partition='row_1'
179177 """
180178 % TESTCASE04_TABLE
181179 )
182180 ret = superset_cursor .fetchall ()
183181 assert len (ret ) == 6
184182 assert [(d [0 ], d [1 ]) for d in superset_cursor .description ] == [
185- ("col_list" , "TEXT " ),
186- ("A" , "REAL " ),
183+ ("col_list" , "STRING " ),
184+ ("A" , "NUMBER " ),
187185 ]
188186
189187 def test_execute_nested_select (self , superset_cursor ):
@@ -325,6 +323,20 @@ def test_sqlean_string_functions(self, superset_cursor):
325323 assert len (ret ) == 2
326324 assert ret [0 ] == ("F" , "F" , "2" )
327325
326+ def test_sqlalchemy_execute_single_select (self , superset_engine ):
327+ _ , conn = superset_engine
328+ rows = conn .execute (
329+ text (
330+ """
331+ SELECT col_list[1] col_list_1, NUMBER(col_map.A)
332+ FROM %s WHERE key_partition=:pk
333+ """
334+ % TESTCASE04_TABLE
335+ ),
336+ {"pk" : "row_2" },
337+ ).fetchall ()
338+ assert len (rows ) == 8
339+
328340 def test_sqlalchemy_execute_nested_select (self , superset_engine ):
329341 _ , conn = superset_engine
330342 rows = conn .execute (
@@ -395,6 +407,7 @@ def test_cached_querydb_step1(self, superset_engine):
395407 os .environ ["PYDYNAMODB_QUERYDB_LOAD_BATCH_SIZE" ] = "20"
396408 os .environ ["PYDYNAMODB_QUERYDB_EXPIRE_TIME" ] = "3"
397409
410+ self .test_sqlalchemy_execute_single_select (superset_engine )
398411 self .test_sqlalchemy_execute_nested_select (superset_engine )
399412 self .test_sqlalchemy_execute_flat_data (superset_engine )
400413 self .test_sqlalchemy_execute_alias_select (superset_engine )
@@ -425,6 +438,7 @@ def test_cached_querydb_step2(self, cursor):
425438
426439 def test_cached_querydb_step3 (self , superset_engine ):
427440 # Cache used
441+ self .test_sqlalchemy_execute_single_select (superset_engine )
428442 self .test_sqlalchemy_execute_nested_select (superset_engine )
429443 self .test_sqlalchemy_execute_alias_select (superset_engine )
430444
0 commit comments