From b1a59ec7ee0cd78ebb45fc1de9a0eeb4f7e27b5f Mon Sep 17 00:00:00 2001 From: Stefaan Lippens Date: Thu, 6 Apr 2023 17:00:56 +0200 Subject: [PATCH] fixup! Issue #412 synchronize create_job in DataCube/VectorCube/MlModel --- CHANGELOG.md | 3 ++- openeo/rest/connection.py | 12 ++++++++---- openeo/rest/mlmodel.py | 2 -- openeo/rest/vectorcube.py | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6df95dd76..75fea28ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,7 +29,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 moved accordingly to the `VectorCube` class. - Improved documentation on `openeo.processes` and `ProcessBuilder` ([#390](https://github.com/Open-EO/openeo-python-client/issues/390)). -- `DataCube.create_job()` now requires keyword arguments for all but the `out_format` argument. +- `DataCube.create_job()` and `Connection.create_job()` now require + keyword arguments for all but the first argument for clarity. ([#412](https://github.com/Open-EO/openeo-python-client/issues/412)). ### Removed diff --git a/openeo/rest/connection.py b/openeo/rest/connection.py index b85fc4b2a..e75cfe2bb 100644 --- a/openeo/rest/connection.py +++ b/openeo/rest/connection.py @@ -1164,10 +1164,14 @@ def execute(self, process_graph: Union[dict, str, Path]): return self.post(path="/result", json=req, expected_status=200).json() def create_job( - self, process_graph: Union[dict, str, Path], - title: Optional[str] = None, description: Optional[str] = None, - plan: Optional[str] = None, budget: Optional[float] = None, - additional: Optional[dict] = None + self, + process_graph: Union[dict, str, Path], + *, + title: Optional[str] = None, + description: Optional[str] = None, + plan: Optional[str] = None, + budget: Optional[float] = None, + additional: Optional[dict] = None, ) -> BatchJob: """ Posts a job to the back end. diff --git a/openeo/rest/mlmodel.py b/openeo/rest/mlmodel.py index 6a9effdfd..8291c4dba 100644 --- a/openeo/rest/mlmodel.py +++ b/openeo/rest/mlmodel.py @@ -81,7 +81,6 @@ def execute_batch( def create_job( self, - out_format=None, *, title: Optional[str] = None, description: Optional[str] = None, @@ -92,7 +91,6 @@ def create_job( """ Sends a job to the backend and returns a ClientJob instance. - :param out_format: String Format of the job result. :param title: job title :param description: job description :param plan: billing plan diff --git a/openeo/rest/vectorcube.py b/openeo/rest/vectorcube.py index 30ba7c9e1..a9db44110 100644 --- a/openeo/rest/vectorcube.py +++ b/openeo/rest/vectorcube.py @@ -134,7 +134,7 @@ def execute_batch( def create_job( self, - out_format=None, + out_format: Optional[str] = None, *, title: Optional[str] = None, description: Optional[str] = None,