-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
SSECustomerKey
is str
, but AWS docs show using bytes
#328
Comments
Hello. Thanks for the bug report! It looks like |
As you see, I am pretty sure there is some code in |
it's very willing to accept a IMO I think overriding this to be |
@ThisGuyCodes
You can help me by testing unreleased changes: # install uv: https://docs.astral.sh/uv/getting-started/installation/
# build types-boto3-s3 package in ./typings directory
uvx --from git+https://github.com/youtype/mypy_boto3_builder@main mypy_boto3_builder ./vendored --product types-boto3-services -s s3 --output-type wheel
# install generated package
pip install vendored/types_boto3_s3*
# run type checker on your codebase Please test if you have time and let me know if it works as expected. |
I'm not sure I did this right, but no it's still failing: $ uvx --from git+https://github.com/youtype/mypy_boto3_builder@main mypy_boto3_builder ./vendored --product types-boto3-services -s s3 --output-type wheel
Updated https://github.com/youtype/mypy_boto3_builder (ff90cfba)
13:03:20 mypy_boto3_builder: INFO Generating types-boto3-services product
13:03:20 mypy_boto3_builder: WARNING boto3 is not installed, using botocore version: 1.35.74
13:03:20 mypy_boto3_builder: INFO [1/1] Generating types-boto3-s3 1.35.74.post1
$ uv pip install vendored/types_boto3*
Resolved 1 package in 1ms
Prepared 1 package in 4ms
Uninstalled 1 package in 3ms
Installed 1 package in 1ms
~ types-boto3-s3==1.35.74.post1 (from file:///Users/travisjohnson/code/whelp/vendored/types_boto3_s3-1.35.74.post1-py3-none-any.whl)
$ uv run pyright main.py
/Users/travisjohnson/code/whelp/main.py
/Users/travisjohnson/code/whelp/main.py:28:24 - error: Argument of type "bytes" cannot be assigned to parameter "SSECustomerKey" of type "str" in function "head_object"
"bytes" is not assignable to "str" (reportArgumentType)
1 error, 0 warnings, 0 informations
$ I have no system-wide |
Hmm, you did everything right. As I see, the pacakge has been successfully installed in your Also, you can check I tested the change locally, it should work. I am going to release updated package tomorrow. |
Good! THank you for testing. You can also generate type annotations for # aiobotocore
uvx --from git+https://github.com/youtype/mypy_boto3_builder@main mypy_boto3_builder ./vendored --product aiobotocore-services -s s3
pip install vendored/types_aiobotocore_s3* Type annotatiosn for aio libraries are different, so it is not safe to use |
Fixed in the latest builder release. Also, I released packages with the fix included:
Please let me know if it works as expected now. |
Hmm, probably docs are misleading a bit.
The bugfix for this issue is included to |
perhaps you misunderstood? With |
For some reason |
Fixed in 8.6.2 and published updated |
Describe the bug
the
SSECustomerKey
arg (for various operations) is typestr
, but various AWS docs very clearly show passing in abytes
. This is a binary value so I believebytes
is "more" correct.Example docs: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#uploading-downloading-files-using-sse-customer-keys
sample from above link:
To Reproduce
key
will have a red underline, Pyright gives me this:Additional context
MacOS: 14.6.1
Boto3: 1.35.74
types-boto3[essential]: 1.35.74
The text was updated successfully, but these errors were encountered: