Skip to content

Commit 5f231e0

Browse files
committed
Issue #279 save_ml_model has no format parameter
1 parent b308b76 commit 5f231e0

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

openeo/rest/mlmodel.py

+6-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import json
22
import pathlib
3-
from typing import Union
3+
from typing import Union, Optional
44
import typing
55

66
from openeo.internal.graph_building import PGNode
@@ -51,12 +51,11 @@ def _api_version(self):
5151
def connection(self):
5252
return self._connection
5353

54-
def save_ml_model(self, format: str = "default", options: dict = None):
54+
def save_ml_model(self, options: Optional[dict] = None):
5555
pgnode = PGNode(
5656
process_id="save_ml_model",
5757
arguments={
58-
"data": {'from_node': self._pg},
59-
"format": format,
58+
"data": {"from_node": self},
6059
"options": options or {}
6160
}
6261
)
@@ -86,17 +85,10 @@ def execute_batch(
8685
print=print, max_poll_interval=max_poll_interval, connection_retry_interval=connection_retry_interval
8786
)
8887

89-
def send_job(self, out_format=None, job_options=None, **format_options) -> RESTJob:
88+
def send_job(self, **kwargs) -> RESTJob:
9089
"""
9190
Sends a job to the backend and returns a ClientJob instance.
9291
93-
:param out_format: String Format of the job result.
94-
:param job_options:
95-
:param format_options: String Parameters for the job result format
96-
:return: status: ClientJob resulting job.
92+
:return: resulting job.
9793
"""
98-
shp = self
99-
if out_format:
100-
# add `save_result` node
101-
shp = shp.save_ml_model(format=out_format, options=format_options)
102-
return self._connection.create_job(process_graph=shp.flat_graph(), additional=job_options)
94+
return self._connection.create_job(process_graph=self.flat_graph(), **kwargs)

0 commit comments

Comments
 (0)