starburstdata/dbt-trino

Refactor test_prepared_statements.py

damian3031 opened this issue · 1 comments

Expected behavior

Currently, this test is about checking last 3 queries in history, if any query contained "EXECUTE" clause here.
But, when running tests on galaxy instance, some queries can be run in between those 3 related to prepare statements (PREPARE, EXECUTE, DEALLOCATE PREPARE)
and test would result in fail, even if desired mechanism of prepared statements was acivated.
Maybe it would be better to refactor this test in a way to handle such cases, maybe we shouldnt limit to last 3 queries, but to queries which were finished in last 1 or 2 seconds for example?

Actual behavior

Test results in false failed on galaxy, if some other queries are run in between

Steps To Reproduce

Run tests from test_prepared_statements.py while some other queries are being runned on galaxy instance

Log output/Screenshots

galaxy_query

Operating System

macOS

dbt version

1.4.1

Trino Server version

406

Python version

3.10

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

This test can be removed. Before we had a flag to disable prepared statements. As we removed the flag, we don't need to test this in dbt-trino specifically.