Skip to content

Commit

Permalink
fixup! Issue #404/PR #481 introduce connection level auto_validate op…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
soxofaan committed Oct 17, 2023
1 parent 54a42d3 commit 0157f8e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions openeo/rest/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,9 @@ def _preflight_validation(self, pg_with_metadata: dict, *, validate: Optional[bo
:param pg_with_metadata: flat dict representation of process graph with metadata,
e.g. as produced by `_build_request_with_process_graph`
:param validate: optional toggle to force/prevent validation with `/validation` endpoint
:param validate: Optional toggle to enable/prevent validation of the process graphs before execution
(overruling the connection's ``auto_validate`` setting).
:return:
"""
if validate is None:
Expand Down Expand Up @@ -1523,6 +1525,8 @@ def download(
or as local file path or URL
:param outputfile: output file
:param timeout: timeout to wait for response
:param validate: Optional toggle to enable/prevent validation of the process graphs before execution
(overruling the connection's ``auto_validate`` setting).
"""
pg_with_metadata = self._build_request_with_process_graph(process_graph=graph)
self._preflight_validation(pg_with_metadata=pg_with_metadata, validate=validate)
Expand Down Expand Up @@ -1552,6 +1556,9 @@ def execute(
:param process_graph: (flat) dict representing a process graph, or process graph as raw JSON string,
or as local file path or URL
:param validate: Optional toggle to enable/prevent validation of the process graphs before execution
(overruling the connection's ``auto_validate`` setting).
:return: parsed JSON response
"""
pg_with_metadata = self._build_request_with_process_graph(process_graph=process_graph)
Expand All @@ -1572,7 +1579,7 @@ def create_job(
plan: Optional[str] = None,
budget: Optional[float] = None,
additional: Optional[dict] = None,
validate: Optional[bool] = True,
validate: Optional[bool] = None,
) -> BatchJob:
"""
Create a new job from given process graph on the back-end.
Expand All @@ -1584,6 +1591,8 @@ def create_job(
:param plan: billing plan
:param budget: maximum cost the request is allowed to produce
:param additional: additional job options to pass to the backend
:param validate: Optional toggle to enable/prevent validation of the process graphs before execution
(overruling the connection's ``auto_validate`` setting).
:return: Created job
"""
# TODO move all this (BatchJob factory) logic to BatchJob?
Expand Down

0 comments on commit 0157f8e

Please sign in to comment.