From 4bdd41f57e7600e1ed2870d5f55b38dc9554c5b5 Mon Sep 17 00:00:00 2001 From: Stefaan Lippens Date: Thu, 3 Aug 2023 09:32:48 +0200 Subject: [PATCH] fixup! Issue #114/#200 support promoting feature properties to cube values --- openeo_driver/datacube.py | 2 +- tests/test_vectorcube.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openeo_driver/datacube.py b/openeo_driver/datacube.py index e8f18a88..d4cadf71 100644 --- a/openeo_driver/datacube.py +++ b/openeo_driver/datacube.py @@ -321,7 +321,7 @@ def from_fiona( if len(paths) != 1: # TODO #114 EP-3981: support multiple paths raise FeatureUnsupportedException(message="Loading a vector cube from multiple files is not supported") - columns_for_cube = options.get("columns_for_cube", cls.COLUMN_SELECTION_NUMERICAL) + columns_for_cube = (options or {}).get("columns_for_cube", cls.COLUMN_SELECTION_NUMERICAL) # TODO #114 EP-3981: lazy loading like/with DelayedVector # note for GeoJSON: will consider Feature.id as well as Feature.properties.id if "parquet" == driver: diff --git a/tests/test_vectorcube.py b/tests/test_vectorcube.py index c99e332d..def8322f 100644 --- a/tests/test_vectorcube.py +++ b/tests/test_vectorcube.py @@ -375,7 +375,7 @@ def test_from_geometry(self, geometry, expected): ], ) def test_from_fiona(self, path, driver): - vc = DriverVectorCube.from_fiona([path], driver=driver, columns_for_cube=[]) + vc = DriverVectorCube.from_fiona([path], driver=driver, options={"columns_for_cube": []}) assert vc.to_geojson() == DictSubSet( { "type": "FeatureCollection",