Skip to content

Commit 909200d

Browse files
committed
Issue #346 Some more ProcessArgs porting
for less boilerplate code and better/earlier error messages
1 parent 6cfd883 commit 909200d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

openeo_driver/ProcessGraphDeserializer.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,7 +1524,10 @@ def mask_polygon(args: ProcessArgs, env: EvalEnv) -> DriverDataCube:
15241524
return cube
15251525

15261526

1527-
def _extract_temporal_extent(args: dict, field="extent", process_id="filter_temporal") -> Tuple[str, str]:
1527+
def _extract_temporal_extent(
1528+
args: Union[dict, ProcessArgs], field="extent", process_id="filter_temporal"
1529+
) -> Tuple[str, str]:
1530+
# TODO #346: make this a ProcessArgs method?
15281531
extent = extract_arg(args, name=field, process_id=process_id)
15291532
if len(extent) != 2:
15301533
raise ProcessParameterInvalidException(
@@ -1571,7 +1574,10 @@ def filter_labels(args: ProcessArgs, env: EvalEnv) -> DriverDataCube:
15711574
return cube.filter_labels(condition=condition, dimension=dimension, context=context, env=env)
15721575

15731576

1574-
def _extract_bbox_extent(args: dict, field="extent", process_id="filter_bbox", handle_geojson=False) -> dict:
1577+
def _extract_bbox_extent(
1578+
args: Union[dict, ProcessArgs], field="extent", process_id="filter_bbox", handle_geojson=False
1579+
) -> dict:
1580+
# TODO #346: make this a ProcessArgs method?
15751581
extent = extract_arg(args, name=field, process_id=process_id)
15761582
# TODO #114: support vector cube
15771583
if handle_geojson and extent.get("type") in [

0 commit comments

Comments
 (0)