Skip to content
Merged
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
4d657c4
fix: retry run_query on empty run_operation result (flaky fusion test)
devin-ai-integration[bot] Feb 25, 2026
c975eef
fix: add short delay between run_query retries
devin-ai-integration[bot] Feb 25, 2026
f1f1ca5
fix: scope run_query retry to fusion runner only
devin-ai-integration[bot] Feb 26, 2026
4384897
fix: apply run_query retry to all runners (not fusion-only)
devin-ai-integration[bot] Feb 26, 2026
268d3d0
fix: bypass run_operation log parsing with direct adapter connection
devin-ai-integration[bot] Feb 26, 2026
ae53f25
fix: fall back to run_operation for queries with non-ref Jinja
devin-ai-integration[bot] Feb 26, 2026
69ac36e
refactor: address review comments - lazy init, source resolution, man…
devin-ai-integration[bot] Feb 26, 2026
0ca8ca3
refactor: use tenacity for run_operation retry
devin-ai-integration[bot] Feb 26, 2026
77f5ddc
chore: add tenacity as direct test dependency
devin-ai-integration[bot] Feb 26, 2026
08a6ebb
fix: surface seed and init failures instead of swallowing them
devin-ai-integration[bot] Feb 26, 2026
6b4acf9
refactor: early exit on init failure to reduce log noise
devin-ai-integration[bot] Feb 26, 2026
148b1d9
Merge branch 'devin/1772105501-investigate-databricks-schema-failures…
devin-ai-integration[bot] Feb 26, 2026
69e1213
Merge remote-tracking branch 'origin/master' into devin/1772040020-fi…
devin-ai-integration[bot] Feb 26, 2026
4869797
refactor: address review comments - BaseAdapter type, custom Unsuppor…
devin-ai-integration[bot] Feb 26, 2026
b722905
refactor: log fallback to run_operation and use tenacity before_sleep…
devin-ai-integration[bot] Feb 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions integration_tests/tests/dbt_project.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import os
import time
from contextlib import contextmanager, nullcontext
from pathlib import Path
from tempfile import NamedTemporaryFile
Expand Down Expand Up @@ -59,14 +60,30 @@ def __init__(
self.tmp_models_dir_path = self.models_dir_path / "tmp"
self.seeds_dir_path = self.project_dir_path / "data"

_RUN_QUERY_MAX_RETRIES = 3
_RUN_QUERY_RETRY_DELAY_SECONDS = 0.5
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move these constants to the top of the file


def run_query(self, prerendered_query: str):
Comment thread
haritamar marked this conversation as resolved.
results = json.loads(
self.dbt_runner.run_operation(
for attempt in range(1, self._RUN_QUERY_MAX_RETRIES + 1):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe create a helper _run_query_with_run_operation method, and then wrap it with tenacity retry decorator?

run_operation_results = self.dbt_runner.run_operation(
"elementary.render_run_query",
macro_args={"prerendered_query": prerendered_query},
)[0]
)
if run_operation_results:
return json.loads(run_operation_results[0])
logger.warning(
"run_operation('elementary.render_run_query') returned no output "
"(attempt %d/%d)",
attempt,
self._RUN_QUERY_MAX_RETRIES,
)
if attempt < self._RUN_QUERY_MAX_RETRIES:
time.sleep(self._RUN_QUERY_RETRY_DELAY_SECONDS)
raise RuntimeError(
f"run_operation('elementary.render_run_query') returned no output "
f"after {self._RUN_QUERY_MAX_RETRIES} attempts. "
f"Query: {prerendered_query!r}"
)
return results

@staticmethod
def read_table_query(
Expand Down