Skip to content

fix: error to_xarray func blocking, it should pass #98

@benoitlambare

Description

@benoitlambare

Describe the bug
By using to_xarray func, it is stopping the process when getting the error

Image

the error is happening also when using the library xarray directly, but the response is passing

Image

Code To Reproduce
CLI commands or Python code snippet to reproduce the bug. Please use maximum verbosity using:

eodag -vvv [OPTIONS] COMMAND [ARGS]...

or

from eodag import EODataAccessGateway
import pygrib
import pandas as pd
import os
import xarray as xr

dag = EODataAccessGateway()

props = {
    "ecmwf:variable": [  # grib equivalent variable names
        # "2m_temperature",  # t2m
        "volumetric_soil_water_layer_1",  #
        "surface_runoff",  # sro
        "total_evaporation",  # e
        "total_precipitation",  # tp
    ]
}

results = dag.search(
    productType="ERA5_LAND",
    start="2025-06-10",
    end="2025-06-11",
    provider="cop_cds",
    geom="POINT(8.77661 47.95859)",
    **props,
)
######## ISSUE PART #########
# using xarray library -> working
product_paths = dag.download_all(results)
product_dir = product_paths[0]
grib_path = os.path.join(product_dir, "data.grib")
ds = xr.open_dataset(grib_path, engine="cfgrib")

# with to_xarray -> not working
ds = results[0].to_xarray()

print(ds)

Output
Compete output obtained with maximal verbosity.

Environment:

  • Python version: python --version
  • EODAG version: eodag version
  • eodag-cube version

Additional context
Add any other context about the bug here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions