Skip to content
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

response type and parsing - not requests - aiohttp.ClientResponse #800

Closed
dazza-codes opened this issue Apr 14, 2020 · 1 comment
Closed

Comments

@dazza-codes
Copy link
Contributor

RE https://github.com/aio-libs/aiobotocore/blob/master/aiobotocore/endpoint.py#L26

async def convert_to_response_dict(http_response, operation_model):
    """Convert an HTTP response object to a request dict.
    This converts the requests library's HTTP response object to
    a dictionary.
    :type http_response: botocore.vendored.requests.model.Response
    :param http_response: The HTTP response from an AWS service request.
    ... """
    # etc

Is this a legacy of a prior fork or copy-paste from botocore? It seems like it's actually an aiohttp.ClientResponse (or wrapper from aiobotocore._endpoint_helpers.ClientResponseProxy):

It's no longer a :type http_response: botocore.vendored.requests.model.Response because requests was removed.

In August of last year, we made significant improvements to the internals of Botocore to allow for pluggable HTTP clients. A key part of the internal refactoring was changing the HTTP client library from the requests library to urllib3. As part of this change, we also decided to unvendor our HTTP library. This allows us to support a range of versions of urllib3 instead of requiring us to depend on a specific version. This meant that we no longer used the vendored version of requests in Botocore and we could remove this unused code.

Throwing a breakpoint or print statement into convert_to_response_dict reveals:

  • print(type(http_response))
  • aiobotocore._endpoint_helpers.ClientResponseProxy
@thehesiod
Copy link
Collaborator

this is the wording from botocore, see https://github.com/boto/botocore/blob/develop/botocore/endpoint.py#L39. closing as this is from them. If I'm missing something please re-open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants