botocore icon indicating copy to clipboard operation
botocore copied to clipboard

Load Session from Zipfile

Open kojiromike opened this issue 3 years ago • 12 comments

When attempting to use botocore / boto3 in AWS EMR or PySpark, it's necessary to load from a zipfile. However, botocore does not support this.

+ PYTHONPATH=botocore.zip:boto3.zip
+ .venv/bin/python -c 'import boto3; client=boto3.client("rds")'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/var/folders/4f/2ps6fjrj2kn4klgq638844bc0000gq/T/tmp.TKx8uF60/boto3.zip/boto3/__init__.py", line 91, in client
  File "/private/var/folders/4f/2ps6fjrj2kn4klgq638844bc0000gq/T/tmp.TKx8uF60/boto3.zip/boto3/session.py", line 258, in client
  File "/private/var/folders/4f/2ps6fjrj2kn4klgq638844bc0000gq/T/tmp.TKx8uF60/botocore.zip/botocore/session.py", line 827, in create_client
  File "/private/var/folders/4f/2ps6fjrj2kn4klgq638844bc0000gq/T/tmp.TKx8uF60/botocore.zip/botocore/session.py", line 700, in _get_internal_component
  File "/private/var/folders/4f/2ps6fjrj2kn4klgq638844bc0000gq/T/tmp.TKx8uF60/botocore.zip/botocore/session.py", line 924, in get_component
  File "/private/var/folders/4f/2ps6fjrj2kn4klgq638844bc0000gq/T/tmp.TKx8uF60/botocore.zip/botocore/session.py", line 163, in create_default_resolver
  File "/private/var/folders/4f/2ps6fjrj2kn4klgq638844bc0000gq/T/tmp.TKx8uF60/botocore.zip/botocore/loaders.py", line 132, in _wrapper
  File "/private/var/folders/4f/2ps6fjrj2kn4klgq638844bc0000gq/T/tmp.TKx8uF60/botocore.zip/botocore/loaders.py", line 424, in load_data
botocore.exceptions.DataNotFoundError: Unable to load data for: endpoints

This is a re-submission of #1969 with permission from @gliptak, the original author.

kojiromike avatar Jul 12 '21 19:07 kojiromike

Codecov Report

Merging #2437 (8e6384f) into develop (7203964) will increase coverage by 2.01%. The diff coverage is 100.00%.

:exclamation: Current head 8e6384f differs from pull request most recent head 07dbf44. Consider uploading reports for the commit 07dbf44 to get more accurate results

@@             Coverage Diff             @@
##           develop    #2437      +/-   ##
===========================================
+ Coverage    95.00%   97.02%   +2.01%     
===========================================
  Files           60       59       -1     
  Lines        12237    11193    -1044     
===========================================
- Hits         11626    10860     -766     
+ Misses         611      333     -278     
Impacted Files Coverage Δ
botocore/__init__.py 100.00% <ø> (ø)
botocore/loaders.py 99.28% <100.00%> (+<0.01%) :arrow_up:
botocore/configprovider.py 93.46% <0.00%> (-0.99%) :arrow_down:
botocore/validate.py 99.44% <0.00%> (-0.56%) :arrow_down:
botocore/session.py 96.61% <0.00%> (-0.17%) :arrow_down:
botocore/stub.py 97.80% <0.00%> (-0.16%) :arrow_down:
botocore/response.py 92.64% <0.00%> (-0.13%) :arrow_down:
botocore/exceptions.py 99.50% <0.00%> (-0.05%) :arrow_down:
botocore/parsers.py 99.42% <0.00%> (-0.04%) :arrow_down:
botocore/client.py 98.68% <0.00%> (-0.04%) :arrow_down:
... and 35 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7203964...07dbf44. Read the comment docs.

codecov-commenter avatar Jul 12 '21 20:07 codecov-commenter

Hello! I'll try to make sure this continues to get attention until someone engages in a real conversation about it. This is September 2021. The original PR was from Feb 8, 2020.

kojiromike avatar Sep 16 '21 14:09 kojiromike

Hi, friends, it's now October 2021. Trick or treat, please merge this PR 👻 🍫 🍬 !

kojiromike avatar Oct 13 '21 13:10 kojiromike

Can't wait for this!

alete89 avatar Dec 02 '21 19:12 alete89

Hello, it's January 2022. Maybe someone can look at this this year?

kojiromike avatar Jan 20 '22 13:01 kojiromike

Hello, February! I hope the events of this month turn out to be less harmful than they seem right now 🇺🇦.

I also hope that maybe this PR will not be forgotten.

kojiromike avatar Feb 25 '22 14:02 kojiromike

boto3/botocore might also benefit from https://github.com/aws/aws-cli/pull/6828

gliptak avatar Apr 16 '22 15:04 gliptak

Hi, it's May. May I merge this some day?

kojiromike avatar May 18 '22 13:05 kojiromike

Hi, we continue to occasionally have engineers run into this problem. It's a chore to have to remember to explicitly exclude boto3 from our EMR job zipfiles to avoid what appears to us to be a completely unnecessary problem.

kojiromike avatar Jun 02 '22 15:06 kojiromike

Hello from April, 2023, I hope you've been having a great year so far. Any chance someone from AWS could address this?

kojiromike avatar Apr 04 '23 13:04 kojiromike

Hello from June, 2023. It'd be great if AWS could take a look at this.

kojiromike avatar Jun 14 '23 17:06 kojiromike

Hello from April 18, 2024! How's everyone doing this year? Well enough to look at this PR, maybe? :D

kojiromike avatar Apr 18 '24 17:04 kojiromike