Skip to content

Commit a07314b

Browse files
soxofaanPeter Van Bouwel
authored andcommitted
Issue Open-EO#354: avoid numpy arrays from DriverVectorCube.to_internal_json
Note that `DataArray.to_dict()` only supports `data="list"` from xarray>=2023.05. In python 3.8 environments (still default at moment), highest xarray version is 2023.01, where `data` argument is expected to be bool. However, in those situations `data="list"` will be interpreted as True, which is actually fine. So this fix is backward compatible (somewhat accidentally)
1 parent 4b8e3ac commit a07314b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openeo_driver/datacube.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ def to_internal_json(self) -> dict:
556556
"""
557557
return {
558558
"geometries": shapely.geometry.mapping(self._geometries),
559-
"cube": self._cube.to_dict(data="array") if self._cube is not None else None,
559+
"cube": self._cube.to_dict(data="list") if self._cube is not None else None,
560560
}
561561

562562
def get_crs(self) -> CRS:

0 commit comments

Comments
 (0)