-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
[AIRFLOW-5350] Fix bug in the num_retires field in BigQueryHook #5955
[AIRFLOW-5350] Fix bug in the num_retires field in BigQueryHook #5955
Conversation
This should be the final bug-fix (hopefully) for 1.10.5 |
@@ -56,7 +56,7 @@ def __init__(self, | |||
gcp_conn_id=bigquery_conn_id, delegate_to=delegate_to) | |||
self.use_legacy_sql = use_legacy_sql | |||
self.location = location | |||
self.num_retries = self._get_field('num_retries', 5) | |||
self.num_retries = self._get_field('num_retries', 5) or 5 |
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.
This code is repeated in many places. Does this not cause problems elsewhere?
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.
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.
You are right. I have moved it to GCP Base Hook now, what do you think?
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.
I'm fine with this, but we should move this to the GoogleDiscoveryApiHook class in the future.
https://github.com/apache/airflow/pull/5335/files
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.
👍
Travis passed on my fork: https://travis-ci.org/kaxil/airflow/builds/578554554 |
…QueryHook (apache#5955) (#48) cherry-picked from 890adde Co-authored-by: Rajat Srivastava <rajats@twitter.com>
Make sure you have checked all steps below.
Jira
Description
The
num_retries
extra is no set in old connections that were created before 1.10.4, for those fields it's value is None which causes the below error:From the StackOverflow Post:
Tests
TestBigQueryHookWithNumRetries.test_num_retries_is_not_none_by_default
Commits
Documentation
Code Quality
flake8