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

cloudpathlib fails with no_sign_request=True #208

Closed
d33bs opened this issue Jun 13, 2024 · 4 comments
Closed

cloudpathlib fails with no_sign_request=True #208

d33bs opened this issue Jun 13, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@d33bs
Copy link
Member

d33bs commented Jun 13, 2024

Using cloudpathlib==0.18.1 there appears to be a bug which causes cloudpathlib to seek credentials for AWS connections despite passing no_sign_request=True. The error appears as: botocore.exceptions.NoCredentialsError: Unable to locate credentials. On testing this in isolation without CytoTable, a different bug seems to manifest as: NameError: name 'Session' is not defined. See here: https://gist.github.com/d33bs/eb19f864baae89757e0e0969611cf1af .

@d33bs d33bs added the bug Something isn't working label Jun 13, 2024
@d33bs
Copy link
Member Author

d33bs commented Jun 13, 2024

Using existing code from CytoTable to mimic an example appears to work okay:

from cloudpathlib import AnyPath, CloudPath

path = "s3://ladi/Images/FEMA_CAP/2020/70349/DSC_0001_5a63d42e-27c6-448a-84f1-bfc632125b8e.jpg"

processed_path = AnyPath(path)

if isinstance(processed_path, CloudPath):
        processed_path.client = processed_path.client.__class__(no_sign_request=True)

# use this client object to create the CloudPath
processed_path.exists()

@d33bs
Copy link
Member Author

d33bs commented Jun 13, 2024

Opened issue for the Session bug mentioned above through drivendataorg/cloudpathlib#441

@d33bs
Copy link
Member Author

d33bs commented Jun 24, 2024

NameError: name 'Session' is not defined portion of this bug was caused by a missing dependency from cloudpathlib (required optional specification).

@d33bs
Copy link
Member Author

d33bs commented Sep 26, 2024

Closing this issue as the bug no longer appears to persist as demonstrated by passing tests with real AWS S3 data sources within https://github.com/cytomining/CytoTable/blob/main/tests/test_convert_threaded.py . I believe it may have been due to missing optional installs from cloudpathlib in variable development environments.

@d33bs d33bs closed this as completed Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant