Skip to content

Commit

Permalink
Merge pull request #839 from jhkennedy/dont-bonk
Browse files Browse the repository at this point in the history
Only check if results are cloud hosted when there are results
  • Loading branch information
jhkennedy authored Oct 17, 2024
2 parents bd5ee4f + 34f4102 commit 9784e4c
Show file tree
Hide file tree
Showing 4 changed files with 544 additions and 6 deletions.
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).

## [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))

### 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

0 comments on commit 9784e4c

Please sign in to comment.