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

the search_data function raises (unhelpfully) when no results are found #816

Closed
itcarroll opened this issue Sep 17, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@itcarroll
Copy link
Collaborator

results = earthaccess.search_data(
    short_name='SWOT_L2_HR_PIXCVec_2.0',
    temporal=('2023-11-06', '2023-11-07'), 
    point=(0, 0),
)

should return [] but instead raises an IndexError because

response = get_results(self.session, self, limit)
cloud = self._is_cloud_hosted(response[0])

assumes response is not empty

If my claim that returning [] is agreeable, then we better also make sure that earthaccess.download doesn't choke when given [].

@itcarroll itcarroll added the bug Something isn't working label Sep 17, 2024
@chuckwondo
Copy link
Collaborator

@itcarroll, I think this is a dup of #526

@mfisher87
Copy link
Collaborator

Side thought, perhaps when we return an empty list we should log a warning?

@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in earthaccess project Sep 17, 2024
@mfisher87 mfisher87 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 18, 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
Status: Done
Development

No branches or pull requests

3 participants