-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timeout BQ queries #902
Timeout BQ queries #902
Conversation
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the dbt-bigquery contributing guide. |
It's on my wishlist for dbt features! |
@github-christophe-oudar don't know if we'll tackle that in this pr as I think this calls for a consistent approach across adapters but I definitely want to tackle this |
* use dynamic schema in test_grant_access_to.py * use dynamic schema in test_grant_access_to.py * experiment with query job cancel on timeout * modify unit tests * remove test grants change * starting functional test * update functional test and experiment with polling logic * experiment with async wait_for * modifying connections.py for asyncio logic * swap back to new_event_loop * close loop, now seeing asyncio timeoutError * improve order and update functional test * update unit test * add changie * add max_result back to result call in async path * rescope the dbt_profile_target to being a class fixture * raise DbtRuntimeError instead database * remove exception type check in job timeout --------- Co-authored-by: Matthew McKnight <matthew.mcknight@dbtlabs.com> Co-authored-by: Matthew McKnight <91097623+McKnight-42@users.noreply.github.com> (cherry picked from commit 2eb407d)
* use dynamic schema in test_grant_access_to.py * experiment with query job cancel on timeout * modify unit tests * remove test grants change * update functional test and experiment with polling logic * experiment with async wait_for * modifying connections.py for asyncio logic * swap back to new_event_loop * close loop, now seeing asyncio timeoutError * improve order and update functional test * add max_result back to result call in async path * rescope the dbt_profile_target to being a class fixture * raise DbtRuntimeError instead database * remove exception type check in job timeout --------- Co-authored-by: Matthew McKnight <matthew.mcknight@dbtlabs.com> Co-authored-by: Matthew McKnight <91097623+McKnight-42@users.noreply.github.com> (cherry picked from commit 2eb407d) Co-authored-by: colin-rogers-dbt <111200756+colin-rogers-dbt@users.noreply.github.com>
Time out and cancel a model execution if it exceeds the provided number of seconds.
Currently the bigquery python client does not provide us with a mechanism to specify a timeout on the database side. As a workaround until they do we can do the next best thing: timeout the execution, cancel the query and raise an exception.
Note we will only use this new logic if a user specifies the
job_execution_timeout
parameter in their profile. If it is not set we continue using the same behavior as today.resolves #231
docs dbt-labs/docs.getdbt.com/#
Problem
Solution
Checklist