Skip to content

Commit

Permalink
fixup! added auto_decode argument to local.connection.execute
Browse files Browse the repository at this point in the history
  • Loading branch information
soxofaan committed Feb 19, 2024
1 parent fe3a86e commit a3e8b98
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion openeo/local/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,21 @@ def list_udf_runtimes(self) -> dict:
return VisualDict("udf-runtimes", data=runtimes)

def execute(
self, process_graph: Union[dict, str, Path], validate: Optional[bool] = None, auto_decode: bool = None
self,
process_graph: Union[dict, str, Path],
*,
validate: Optional[bool] = None,
auto_decode: bool = True,
) -> xr.DataArray:
"""
Execute locally the process graph and return the result as an xarray.DataArray.
:param process_graph: (flat) dict representing a process graph, or process graph as raw JSON string,
:return: a datacube containing the requested data
"""
if validate:
raise ValueError("LocalConnection does not support process graph validation")
if auto_decode is not True:
raise ValueError("LocalConnection requires auto_decode=True")
process_graph = as_flat_graph(process_graph)
return OpenEOProcessGraph(process_graph).to_callable(PROCESS_REGISTRY)()
1 change: 1 addition & 0 deletions openeo/rest/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1574,6 +1574,7 @@ def download(
def execute(
self,
process_graph: Union[dict, str, Path],
*,
timeout: Optional[int] = None,
validate: Optional[bool] = None,
auto_decode: bool = True,
Expand Down

0 comments on commit a3e8b98

Please sign in to comment.