- Notifications
You must be signed in to change notification settings - Fork 331
Remove use of method_whitelist when possible#532
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
Remove use of method_whitelist when possible #532
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
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.
Thanks for the PR @xmo-odoo. This looks great! I just made a couple of comments. We can merge this once those comments are addressed.
Done and done, though now that I look at the code again I'm wondering: maybe I should remove the current That is, end up with this: ifhasattr(retry.Retry.DEFAULT, 'allowed_methods'): _ANY_METHOD= {'allowed_methods': None} else: _ANY_METHOD= {'method_whitelist': None} # Default retry configuration: Retries once on low-level connection and socket read errors.# Retries up to 4 times on HTTP 500 and 503 errors, with exponential backoff. Returns the# last response upon exhausting all retries.DEFAULT_RETRY_CONFIG=retry.Retry( connect=1, read=1, status=4, status_forcelist=[500, 503], raise_on_status=False, backoff_factor=0.5, **_ANY_METHOD) |
Thanks @xmo-odoo. Your suggestion looks good to me. Feel free to make the change. But I'm happy with the current state of the PR too. |
Deprecated in favor of allowed_methods. Fall back to the old argument for older versions of urllib3 which do not support the new one. Uses conditional attribute check as recommended in urllib3/urllib3#2057
@hiranya911 I pushed the updated version. |
With version of urllib3 in ubuntu 22.04 (1.26.5) and with version of firebase_admin between 2.17.0 and 4.5.2 a gives the following warning: In firebase_admin/_http_client.py:30: DeprecationWarning: Using 'method_whitelist' with Retry is deprecated and will be removed in v2.0. Use 'allowed_methods' instead It has been fixed in later version firebase/firebase-admin-python#532 since v4.5.2
With version of urllib3 in ubuntu 22.04 (1.26.5) and with version of firebase_admin between 2.17.0 and 4.5.2 a gives the following warning: In firebase_admin/_http_client.py:30: DeprecationWarning: Using 'method_whitelist' with Retry is deprecated and will be removed in v2.0. Use 'allowed_methods' instead It has been fixed in later version firebase/firebase-admin-python#532 since v4.5.2 closes#101444 Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
With version of urllib3 in ubuntu 22.04 (1.26.5) and with version of firebase_admin between 2.17.0 and 4.5.2 a gives the following warning: In firebase_admin/_http_client.py:30: DeprecationWarning: Using 'method_whitelist' with Retry is deprecated and will be removed in v2.0. Use 'allowed_methods' instead It has been fixed in later version firebase/firebase-admin-python#532 since v4.5.2 closes#101444 Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
With version of urllib3 in ubuntu 22.04 (1.26.5) and with version of firebase_admin between 2.17.0 and 4.5.2 a gives the following warning: In firebase_admin/_http_client.py:30: DeprecationWarning: Using 'method_whitelist' with Retry is deprecated and will be removed in v2.0. Use 'allowed_methods' instead It has been fixed in later version firebase/firebase-admin-python#532 since v4.5.2 X-original-commit: 66934cd
With version of urllib3 in ubuntu 22.04 (1.26.5) and with version of firebase_admin between 2.17.0 and 4.5.2 a gives the following warning: In firebase_admin/_http_client.py:30: DeprecationWarning: Using 'method_whitelist' with Retry is deprecated and will be removed in v2.0. Use 'allowed_methods' instead It has been fixed in later version firebase/firebase-admin-python#532 since v4.5.2 closes#101731 X-original-commit: 66934cd Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Deprecated in favor of allowed_methods. Fall back to the old argument for older
versions of urllib3 which do not support the new one.
Uses conditional attribute check as recommended in
urllib3/urllib3#2057
Fixes#515
RELEASE NOTE: Fixed a bug that prevented the proper operation of the SDK when used with certain versions of the
urllib3
package.