aas.backend: Support urllib3 version 2#294
Conversation
| @classmethod | ||
| def do_request(cls, url: str, method: str = "GET", additional_headers: Dict[str, str] = {}, | ||
| body: Optional[bytes] = None) -> Dict[str, Any]: | ||
| body: Optional[bytes] = None) -> MutableMapping[str, Any]: |
There was a problem hiding this comment.
Instead of changing the return type to the more generic MutableMappingwe could also add HTTPHeaderDict as Union.
Alternatively we can leave Dict return type and transform the response.headers into a normal dict in line 158. However this produces additional overhead, e.g.:
return {key: value for key, value in response.headers.items()}
There was a problem hiding this comment.
I have no strong opinion on which type should be used here.
|
Hi @JGrothoff thank you for your contribution! I'm happy to introduce |
|
Hi @s-heppner, thank you for the review. I adapted the files accordingly. |
s-heppner
left a comment
There was a problem hiding this comment.
LGTM, thank you very much for your contribution!
The previous version contraint
urllib3>=1.26,<2.0is verry restrictive.I need to use the SDK in a project together with other libs (e.g. gradio) that require urlib3 >= 2.
I widened the version constraint according to urllib3 migration guide and did't see any deprecation warnings (hopefully i turned them on correctly).