Update GoogleBaseHook to not follow 308 and use 60s timeout#8816
Update GoogleBaseHook to not follow 308 and use 60s timeout#8816mik-laj merged 4 commits intoapache:masterfrom waiyan1612:fix/google-hook-httplib2-exclude-308
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? |
| return self._get_credentials().token | ||
|
|
||
| @staticmethod | ||
| def _build_http() -> httplib2.Http: |
There was a problem hiding this comment.
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.
httplib2recently 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.httpsince it will introduce a default timeout of 60s if no timeout was set previously.EDIT
After discussing with @mik-laj, agreed that using
build_httpis 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.