-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Feature/bq improvements #507
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs a couple tweaks
dbt/adapters/bigquery.py
Outdated
@@ -111,6 +118,9 @@ def open_connection(cls, connection): | |||
result = connection.copy() | |||
credentials = connection.get('credentials', {}) | |||
|
|||
if 'timeout_seconds' in credentials: | |||
cls.QUERY_TIMEOUT = credentials['timeout_seconds'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't mutate global state. a better way:
- make
poll_until_job_completes
take a timeout as an argument - then call it with
poll_until_job_completes(job, timeout=connection.get('credentials', {}).get('timeout_seconds'), cls.DEFAULT_QUERY_TIMEOUT)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(and remove this logic altogether)
dbt/adapters/bigquery.py
Outdated
query = client.run_sync_query(formatted_sql) | ||
query.timeout_ms = cls.QUERY_TIMEOUT | ||
query = client.run_sync_query(sql) | ||
query.timeout_ms = cls.QUERY_TIMEOUT * 1000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
query timeout override is not respected here
Query google sheets: #502
Add tables: #504