Skip to content

[BUG] incorrect typing on get_s3_filesystem has led open_virtual_mfdataset astray #906

@itcarroll

Description

@itcarroll

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

The earthaccess.open_virtual_mfdataset function with access="direct" returns a KeyError: 0.

Here the earthaccess.get_s3_filesystem is given granules[0] when it should be given granules.

fs = earthaccess.get_s3_filesystem(results=granules[0])

Here the typing is misleading and should be Optional[list[DataGranule]].

results: Optional[DataGranule] = None,

Expected Behavior

The earthaccess.open_virtual_mfdataset function with access="direct" returns a dataset.

Steps To Reproduce

import earthaccess

results = earthaccess.search_data(
    short_name="MUR-JPL-L4-GLOB-v4.1",
    temporal=("2010-01-01", "2010-01-31"),
)
earthaccess.open_virtual_mfdataset(
    results,
    access="direct",
    load=False,
    concat_dim="time",
    coords="all",
    compat="override",
    combine_attrs="drop_conflicts",
)

Environment

- OS: openscapes.2i2c
- Python: 3.12.0

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    ✅ Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions