Skip to content

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

Open
@mike-gangl

Description

@mike-gangl

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions