IBM / python-sdk-core

The python-sdk-core repository contains core functionality required by Python code generated by the IBM OpenAPI SDK Generator.
Apache License 2.0
20 stars 27 forks source link

TypeError: Retry.__init__() got an unexpected keyword argument 'backoff_max' #190

Closed xsuchy closed 6 months ago

xsuchy commented 6 months ago

The tests from vpc-python-sdk recently started to failing. It fails on calling enable_retries(). I found that the culprit is python-sdk-core. Mainly https://github.com/IBM/python-sdk-core/blob/main/ibm_cloud_sdk_core/base_service.py#L134

The code fails with:

>>> retry_config = Retry(
...             total=max_retries,
...             backoff_factor=1.0,
...             backoff_max=retry_interval,
...             # List of HTTP status codes to retry on in addition to Timeout/Connection Errors
...             status_forcelist=[429, 500, 502, 503, 504],
...             # List of HTTP methods to retry on
...             # Omitting this will default to all methods except POST
...             allowed_methods=['HEAD', 'GET', 'PUT', 'DELETE', 'OPTIONS', 'TRACE', 'POST'],
...         )
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Retry.__init__() got an unexpected keyword argument 'backoff_max

The documentation mention this variable https://urllib3.readthedocs.io/en/latest/reference/urllib3.util.html but I checked the urllib3 source code and this param is not available in constructor. And never was! So this could not ever work.

xsuchy commented 6 months ago

Hmm. I it present in urllib3 version 2.0.0 https://urllib3.readthedocs.io/en/latest/changelog.html#added

And I somehow missed the requirements.txt where this dependency is specified. Sorry for the noise.