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

Cannot programmatically determine cause of failures from Auth.get_s3_credentials method #776

Open
chuckwondo opened this issue Jul 27, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@chuckwondo
Copy link
Collaborator

When the Auth.get_s3_credentials method fails to fetch s3 credentials, it simply returns an empty dict. Unfortunately, this makes it impossible to tell why it failed, since there are several possible cases for failure.

Consider a means for determining the cause of a failure, perhaps by raising various exception types to distinguish the various cases from each other.

Not being able to distinguish the various causes of failures can make it difficult to determine an appropriate course of action to take. Even within this library's integration tests, we cannot make a determination, which prevents the test from knowing whether a failure is an acceptable failure, allowing the test to pass, or one that should cause the test to fail.

For reference, see https://github.com/nsidc/earthaccess/blob/main/tests/integration/test_auth.py#L94, where we reach this line because the call to Auth.get_s3_credentials does not raise an exception, but the test will fail because it thus expects to find credentials in the return value, but doesn't. Unfortunately, there seems to be cases where the test should not fail even though the method call fails, but currently there's no way to distinguish "acceptable" failures from unacceptable failures.

@chuckwondo chuckwondo added the enhancement New feature or request label Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant