|
9 | 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10 | 10 | # See the License for the specific language governing permissions and
|
11 | 11 | # limitations under the License
|
| 12 | +import os |
12 | 13 | import pytest
|
13 | 14 | import sqlalchemy as sqla
|
14 | 15 | from sqlalchemy.sql import and_, or_, not_
|
@@ -177,6 +178,22 @@ def test_conjunctions(trino_connection):
|
177 | 178 | assert len(rows) == 1
|
178 | 179 |
|
179 | 180 |
|
| 181 | +@pytest.mark.parametrize('trino_connection', ['system'], indirect=True) |
| 182 | +def test_completed_states(trino_connection): |
| 183 | + _, conn = trino_connection |
| 184 | + metadata = sqla.MetaData() |
| 185 | + queries = sqla.Table('queries', metadata, schema='runtime', autoload_with=conn) |
| 186 | + s = sqla.select(queries.c.state).where(queries.c.query == "SELECT version()") |
| 187 | + result = conn.execute(s) |
| 188 | + rows = result.fetchall() |
| 189 | + assert len(rows) > 0 |
| 190 | + for row in rows: |
| 191 | + if os.environ.get("TRINO_VERSION") == '351': |
| 192 | + assert row['state'] == 'FAILED' |
| 193 | + else: |
| 194 | + assert row['state'] == 'FINISHED' |
| 195 | + |
| 196 | + |
180 | 197 | @pytest.mark.parametrize('trino_connection', ['tpch'], indirect=True)
|
181 | 198 | def test_textual_sql(trino_connection):
|
182 | 199 | _, conn = trino_connection
|
|
0 commit comments