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

Only check if results are cloud hosted when there are results #839

Merged
merged 6 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Common Changelog](https://common-changelog.org/)
and this project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 💯 💯


## [Unreleased]

### Changed

- Use built-in `assert` statements instead of `unittest` assertions in
integration tests ([#743](https://github.com/nsidc/earthaccess/issues/743))
(@chuckwondo)
([@chuckwondo](https://github.com/chuckwondo))
jhkennedy marked this conversation as resolved.
Show resolved Hide resolved

### Added

- Add support for `NETRC` environment variable to override default `.netrc` file
location ([#480](https://github.com/nsidc/earthaccess/issues/480))
(@chuckwondo)
([@chuckwondo](https://github.com/chuckwondo))
- Add `nox` session for running integration tests locally
([#815](https://github.com/nsidc/earthaccess/issues/815)) (@chuckwondo)
([#815](https://github.com/nsidc/earthaccess/issues/815)) ([@chuckwondo](https://github.com/chuckwondo))
- Auto-add comment to PR that requires maintainer to review and re-run
integration tests ([#824](https://github.com/nsidc/earthaccess/issues/824))
(@chuckwondo)
([@chuckwondo](https://github.com/chuckwondo))

### Removed

### Fixed


- Integration tests no longer clobber existing `.netrc` file
([#806](https://github.com/nsidc/earthaccess/issues/806))
(@chuckwondo)
- Return an empty list instead of raising an `IndexError` when searches find no results.
([#526](https://github.com/nsidc/earthaccess/issues/526))
([@jhkennedy](https://github.com/jhkennedy))

## [0.11.0] 2024-10-01

Expand Down
3 changes: 1 addition & 2 deletions earthaccess/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,7 @@ def get(self, limit: int = 2000) -> List[DataGranule]:
RuntimeError: The CMR query failed.
"""
response = get_results(self.session, self, limit)

cloud = self._is_cloud_hosted(response[0])
cloud = len(response) > 0 and self._is_cloud_hosted(response[0])

return [DataGranule(granule, cloud_hosted=cloud) for granule in response]

Expand Down
Loading
Loading