Skip to content

[BUG] Collections without 'FileDistributionInformation' elements will fail 'summary()' call #970

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

Open
1 task done
mike-gangl opened this issue Mar 28, 2025 · 0 comments · May be fixed by #971
Open
1 task done
Labels
type: bug Something isn't working

Comments

@mike-gangl
Copy link

Is this issue already tracked somewhere, or is this a new report?

  • I've reviewed existing issues and couldn't find a duplicate for this problem.

Current Behavior

Requesting a collection that does not contain a FileDistributionInformation element will throw an exception when attempting to read the data_type for summary calls.

https://github.com/nsidc/earthaccess/blob/main/earthaccess/results.py#L120-L132

Expected Behavior

The collection is returned without data_type summary information.

Steps To Reproduce

results = earthaccess.search_dataset(short_name="AIRS_CPR_IND", daac="GES_DISC")
results[0].summary()
DEBUG:__main__:10 DEBUG:__main__:C2515837343-GES_DISC
ERROR:root:Traceback (most recent call last): File "/Users/gangl/dev/podaac/model-context-protocol/cmr-search/cmr-search.py", line 24, in format_dataset Shortname: {props.summary()['short-name']} File "/Users/gangl/dev/podaac/model-context-protocol/cmr-search/.venv/lib/python3.10/site-packages/earthaccess/results.py", line 92, in summary "file-type": self.data_type(), File "/Users/gangl/dev/podaac/model-context-protocol/cmr-search/.venv/lib/python3.10/site-packages/earthaccess/results.py", line 128, in data_type self["umm"]["ArchiveAndDistributionInformation"][ KeyError: 'FileDistributionInformation'

Environment

- OS: MacOSX
- Python: 3.11

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
Status: 🆕 New
2 participants