From e5d315e61c9a7f5afb661bdb48169e275fbc1d97 Mon Sep 17 00:00:00 2001 From: Stephane Restani Date: Tue, 3 Mar 2026 14:15:40 +0100 Subject: [PATCH] [forge] Remove run_advanced_tool This was an experimental feature that got pruned eventually. --- src/picterra/forge_client.py | 24 ------------------------ tests/test_forge_client.py | 24 ------------------------ 2 files changed, 48 deletions(-) diff --git a/src/picterra/forge_client.py b/src/picterra/forge_client.py index ed90884..7835e69 100644 --- a/src/picterra/forge_client.py +++ b/src/picterra/forge_client.py @@ -746,30 +746,6 @@ def run_dataset_recommendation(self, detector_id: str): raise APIError(resp.text) return self._wait_until_operation_completes(resp.json()) - def run_advanced_tool( - self, tool_id: str, inputs: dict[str, Any], outputs: dict[str, Any] - ): - """ - This is an experimental feature - - Runs a tool and waits for its execution, returning the finished operation metadata - - Args: - tool_id: The id of the tool to run - inputs: tool inputs - outputs: tool outputs - - Raises: - APIError: There was an error while launching and executing the tool - """ - resp = self.sess.post( - self._full_url("advanced_tools/%s/run/" % tool_id), - json={"inputs": inputs, "outputs": outputs}, - ) - if not resp.ok: - raise APIError(resp.text) - return self._wait_until_operation_completes(resp.json()) - def upload_vector_layer( self, raster_id: str, diff --git a/tests/test_forge_client.py b/tests/test_forge_client.py index f4ae96a..b93045e 100644 --- a/tests/test_forge_client.py +++ b/tests/test_forge_client.py @@ -1166,30 +1166,6 @@ def test_list_raster_vector_layers(monkeypatch): ) -@responses.activate -def test_run_advanced_tool(monkeypatch): - _add_api_response( - detector_api_url("advanced_tools/foobar/run/"), - responses.POST, - json=OP_RESP, - match=responses.matchers.json_params_matcher( - { - "inputs": {"foo": "bar"}, - "outputs": {"spam": [1, 2], "bar": {"foo": None, "bar": 4}}, - } - ), - ) - add_mock_operations_responses("success") - client = _client(monkeypatch) - assert ( - client.run_advanced_tool( - "foobar", {"foo": "bar"}, {"spam": [1, 2], "bar": {"foo": None, "bar": 4}} - )["type"] - == "mock_operation_type" - ) - assert len(responses.calls) == 2 - - @responses.activate def test_import_raster_from_remote_source(monkeypatch): body = {