Open-EO / openeo-processes-dask

Python implementations of many OpenEO processes, dask-friendly by default.
Apache License 2.0
19 stars 14 forks source link

filter_temporal/filter_spatial usage gives weird error #281

Open soxofaan opened 5 days ago

soxofaan commented 5 days ago

I was playing around with cross-backend workflow execution and stumbled on this problem in the EODC backend:

import openeo
connection = openeo.connect(url="openeo.eodc.eu").authenticate_oidc()

temporal_extent = ["2020-08-01", "2020-08-10"]
bbox = {"west": 5.07, "south": 51.21, "east": 5.10, "north": 51.23}

cube = connection.load_collection(
    "boa_sentinel_2",
    bands=["B03"],
)
cube = cube.filter_temporal(temporal_extent)
cube = cube.filter_bbox(bbox)
result = cube.save_result(format="NetCDF")

result.download("tmp.nc")

The download fails with

OpenEoApiError: [500] Internal Error: 'NoneType' object is not subscriptable

soxofaan commented 5 days ago

Note that doing the temporal/spatial filtering directly in load_collection (instead of filter_temporal/filter_spatial) works, e.g.

cube = connection.load_collection(
    "boa_sentinel_2",
    temporal_extent=temporal_extent,
    spatial_extent=bbox,
    bands=["B03"],
)
soxofaan commented 5 days ago

If I run it as a batch job, I get these batch job logs:

▸ func(*args, named_parameters=named_parameters, **kwargs)
    info
▸ File "/openeo-executor/.venv/lib/python3.11/site-packages/openeo_pg_parser_networkx/graph.py", line 415, in node_callable
    info
▸ result = prebaked_process_impl(
    info
▸ ^^^^^^^^^^^^^^^^^^^^^^
    info
▸ File "/openeo-executor/.venv/lib/python3.11/site-packages/openeo_processes_dask/process_implementations/core.py", line 90, in wrapper
    info
▸ return f(*resolved_args, **resolved_kwargs)
    info
▸ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    info
▸ File "/openeo-executor/.venv/lib/python3.11/site-packages/openeo_processes_dask/process_implementations/cubes/_filter.py", line 44, in filter_temporal
    info
▸ temporal_dims = data.openeo.temporal_dims
    info
▸ ^^^^^^^^^^^
    info
▸AttributeError: 'dict' object has no attribute 'openeo'

(regarding this badly formatted stack trace: see #282 )