Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion openeo_driver/ProcessGraphDeserializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1769,7 +1769,7 @@ def merge_cubes(args: ProcessArgs, env: EvalEnv) -> DriverDataCube:
def run_udf(args: ProcessArgs, env: EvalEnv):
# TODO: note: this implements a non-standard usage of `run_udf`: processing "vector" cube (direct JSON or from aggregate_spatial, ...)
dry_run_tracer: DryRunDataTracer = env.get(ENV_DRY_RUN_TRACER)
data = args.get_required(name="data")
data = args.get_optional(name="data")
udf, runtime = _get_udf(args, env=env)
context = args.get_optional(name="context", default={})

Expand All @@ -1781,6 +1781,14 @@ def run_udf(args: ProcessArgs, env: EvalEnv):
# This way a weak_spatial_extent can be calculated from the UDF's output.
return data.run_udf()

if runtime.lower() == "EOAP-CWL".lower():
return env.backend_implementation.run_cwl(
data=data,
env=env,
cwl=udf,
context=context,
)

if env.get("validation", False):
raise FeatureUnsupportedException("run_udf is not supported in validation mode.")

Expand Down
10 changes: 10 additions & 0 deletions openeo_driver/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,16 @@ def load_ml_model(self, job_id: str) -> DriverMlModel:
def vector_to_raster(self, input_vector_cube: DriverVectorCube, target: DriverDataCube) -> DriverDataCube:
raise NotImplementedError

def run_cwl(
self,
*,
data, # Will be None at atm
env: EvalEnv,
cwl: str,
context: dict,
) -> DriverDataCube:
raise NotImplementedError

def visit_process_graph(self, process_graph: dict) -> ProcessGraphVisitor:
"""Create a process graph visitor and accept given process graph"""
return ProcessGraphVisitor().accept_process_graph(process_graph)
Expand Down