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

Bump botocore dependency specification #1221

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jakob-keller
Copy link
Collaborator

@jakob-keller jakob-keller commented Oct 27, 2024

Description of Change

This PR intends to improve general compatibility of aiobotocore within the Python ecosystem by bumping the dependency specification of botocore, as well as boto3 and awscli.

Assumptions

Upstream diff contains changes that require adjustments to the aiobotocore codebase.

Checklist for All Submissions

  • I have added change info to CHANGES.rst
  • If this is resolving an issue (needed so future developers can determine if change is still necessary and under what conditions) (can be provided via link to issue with these details):
    • Detailed description of issue
    • Alternative methods considered (if any)
    • How issue is being resolved
    • How issue can be reproduced
  • If this is providing a new feature (can be provided via link to issue with these details):
    • Detailed description of new feature
    • Why needed
    • Alternatives methods considered (if any)

Checklist when updating botocore and/or aiohttp versions

  • I have read and followed CONTRIBUTING.rst
  • I have updated test_patches.py where/if appropriate (also check if no changes necessary)
  • I have ensured that the awscli/boto3 versions match the updated botocore version

@jakob-keller jakob-keller added the dependencies Pull requests that update a dependency file label Oct 27, 2024
@jakob-keller jakob-keller self-assigned this Oct 27, 2024
Copy link

codecov bot commented Oct 27, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 86.27%. Comparing base (a2b1b68) to head (04135d5).

Files with missing lines Patch % Lines
aiobotocore/handlers.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1221      +/-   ##
==========================================
- Coverage   86.35%   86.27%   -0.08%     
==========================================
  Files          64       64              
  Lines        5986     5974      -12     
==========================================
- Hits         5169     5154      -15     
- Misses        817      820       +3     
Flag Coverage Δ
unittests 86.27% <50.00%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jakob-keller jakob-keller marked this pull request as ready for review October 27, 2024 14:11
@jakob-keller
Copy link
Collaborator Author

Notes to reviewers:

  • I believe that upstream does not affect any codepaths relevant for us, beyond what is included in this PR. However, I am not 100% sure about _handle_200_error() in handlers.py. Please take a closer look at that aspect, if you can.
  • FWIW: test coverage is not actually any worse than it was before.

@thehesiod
Copy link
Collaborator

Notes to reviewers:

  • I believe that upstream does not affect any codepaths relevant for us, beyond what is included in this PR. However, I am not 100% sure about _handle_200_error() in handlers.py. Please take a closer look at that aspect, if you can.
  • FWIW: test coverage is not actually any worse than it was before.

ya I'm not sure if response_dict['body'] is a coroutine or the actual bytes. I'd put a breakpoint and see what it looks like

@thehesiod
Copy link
Collaborator

I think it's populated here:

if response_dict['status_code'] >= 300:
response_dict['body'] = await http_response.content
elif operation_model.has_event_stream_output:
response_dict['body'] = http_response.raw
elif operation_model.has_streaming_output:
length = response_dict['headers'].get('content-length')
response_dict['body'] = StreamingBody(http_response.raw, length)
else:
response_dict['body'] = await http_response.content
so I think it depends on the response type

@jakob-keller
Copy link
Collaborator Author

jakob-keller commented Oct 28, 2024

I think it's populated here:

if response_dict['status_code'] >= 300:
response_dict['body'] = await http_response.content
elif operation_model.has_event_stream_output:
response_dict['body'] = http_response.raw
elif operation_model.has_streaming_output:
length = response_dict['headers'].get('content-length')
response_dict['body'] = StreamingBody(http_response.raw, length)
else:
response_dict['body'] = await http_response.content

so I think it depends on the response type

Exactly: Case 1 and 4 result in bytes, case 3 cannot be reached in this context, but case 2 on line 60 is tricky. I have no idea under what condition this is reached, if at all, and whether it results in something that needs to be awaited. Beats me!

@thehesiod
Copy link
Collaborator

I think here's an example: https://botocore.amazonaws.com/v1/documentation/api/latest/reference/eventstream.html

@thehesiod
Copy link
Collaborator

isn't line 63 also a coroutine? That's like a s3 get-object body i think

@thehesiod
Copy link
Collaborator

ideally we could add tests for this with moto

@thehesiod
Copy link
Collaborator

btw you should add yourself to the sponsors, you've already done a ton of work

@jakob-keller
Copy link
Collaborator Author

isn't line 63 also a coroutine? That's like a s3 get-object body i think

There's a guard function _should_handle_200_error() that makes that codepath impossible to reach, as far as I can tell.

@jakob-keller
Copy link
Collaborator Author

btw you should add yourself to the sponsors, you've already done a ton of work

Thanks, but I'm good :-)

@jakob-keller
Copy link
Collaborator Author

I think here's an example: https://botocore.amazonaws.com/v1/documentation/api/latest/reference/eventstream.html

ideally we could add tests for this with moto

I could give it a shot towards the end of the week. Thanks for looking into it!

@jakob-keller
Copy link
Collaborator Author

isn't line 63 also a coroutine? That's like a s3 get-object body i think

There's a guard function _should_handle_200_error() that makes that codepath impossible to reach, as far as I can tell.

Actually, I am suspecting that this guard function also prevents case 2 / line 60 from being reached.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file needs-testcase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants