Skip to content

Commit

Permalink
added dev mode to execute query, to incorporate it in the retry method
Browse files Browse the repository at this point in the history
  • Loading branch information
rishsriv committed Apr 9, 2024
1 parent 6c402b0 commit 71fe600
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions defog/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def execute_query(
hard_filters: str = "",
retries: int = 3,
schema: dict = None,
dev: bool = False,
):
"""
Execute the query and retry with adaptive learning if there is an error.
Expand All @@ -144,6 +145,7 @@ def execute_query(
"db_type": db_type,
"question": question,
"query": query,
"dev": dev,
},
timeout=1,
)
Expand All @@ -162,6 +164,7 @@ def execute_query(
"db_type": db_type,
"hard_filters": hard_filters,
"question": question,
"dev": dev,
}
if schema is not None:
retry["schema"] = schema
Expand Down
1 change: 1 addition & 0 deletions defog/query_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def run_query(
question,
hard_filters,
retries,
dev=dev,
)
tend = datetime.now()
time_taken = (tend - tstart).total_seconds()
Expand Down

0 comments on commit 71fe600

Please sign in to comment.