-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
Update GoogleBaseHook to not follow 308 and use 60s timeout #8816
Update GoogleBaseHook to not follow 308 and use 60s timeout #8816
Conversation
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst)
|
I think that's a good idea. Thanks to this, if this library introduces improvements, they will also be available in our HTTP client.
I don't think this is a problem. This option was not user-configurable. Now just save according to the default library behavior. |
@mik-laj Thanks for reviewing the PR. I also think that following
|
|
@waiyan1612 Github action is sad. Can you fix it? |
@@ -207,13 +207,20 @@ def _get_access_token(self) -> str: | |||
""" | |||
return self._get_credentials().token | |||
|
|||
@staticmethod | |||
def _build_http() -> httplib2.Http: |
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.
We do not need to give the opportunity to override this method. If the user needs it, the user can overwrite authorize. It would make sense if _http were used in several places.
Thanks a lot! |
Awesome work, congrats on your first merged pull request! |
Cool. We'll get it in the backport providers :) |
Any chance this is in the backport providers now @potiuk ? |
What's backport providers ? :P No idea. You need to check the release notes in backport providers in PyPI. For me Airflow 1.10 has ended a year ago. Let me add this one here: If you are on 1.10 - MIGRATE. NOW! Our survey have shown that there are < 15% users who use 1.10 and most of them plans to migrate in a month or so. Don't delay. Join the majority. Otherwise only echo will respond to any questions you might have. |
This PR fixes #8810.
httplib2
recently made changes to redirect / follow 308 status code. This conflicts with some Google Drive APIs which are using 308 for resumable uploads. This PR replicates the google-api-python-client fix that addresses the exact same issue.For backward compatibility, I decided against reusing build_http from
googleapiclient.http
since it will introduce a default timeout of 60s if no timeout was set previously.EDIT
After discussing with @mik-laj, agreed that using
build_http
is a better approach. Updated the PR with code changes and test cases accordingly.Make sure to mark the boxes below before creating PR: [x]
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.