diff --git a/.github/.backend_git_ref b/.github/.backend_git_ref index 268bd085..f5fa9fb5 100644 --- a/.github/.backend_git_ref +++ b/.github/.backend_git_ref @@ -1 +1 @@ -35bae875265258dfacb8c9103e6967c7c934406a \ No newline at end of file +af126cb150c974cf47a52d2fac5b4a96a81d2c77 \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b8c72d2..1a9180e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ on: jobs: check: - uses: geo-engine/geoengine-python/.github/workflows/test-python.yml@ubuntu-24 + uses: geo-engine/geoengine-python/.github/workflows/test-python.yml@main strategy: fail-fast: false @@ -28,7 +28,7 @@ jobs: # Checks the library using minimum version resolution # `uv` has this feature built-in, c.f. https://github.com/astral-sh/uv check-min-version: - uses: geo-engine/geoengine-python/.github/workflows/test-python.yml@ubuntu-24 + uses: geo-engine/geoengine-python/.github/workflows/test-python.yml@main with: python-version: 3.9 diff --git a/geoengine/resource_identifier.py b/geoengine/resource_identifier.py index e304a68c..43c622a5 100644 --- a/geoengine/resource_identifier.py +++ b/geoengine/resource_identifier.py @@ -54,7 +54,7 @@ def __init__(self, dataset_name: str) -> None: self.__dataset_name = dataset_name @classmethod - def from_response(cls, response: geoengine_openapi_client.CreateDatasetHandler200Response) -> DatasetName: + def from_response(cls, response: geoengine_openapi_client.DatasetNameResponse) -> DatasetName: '''Parse a http response to an `DatasetName`''' return DatasetName(response.dataset_name) @@ -71,8 +71,8 @@ def __eq__(self, other) -> bool: return self.__dataset_name == other.__dataset_name # pylint: disable=protected-access - def to_api_dict(self) -> geoengine_openapi_client.CreateDatasetHandler200Response: - return geoengine_openapi_client.CreateDatasetHandler200Response( + def to_api_dict(self) -> geoengine_openapi_client.DatasetNameResponse: + return geoengine_openapi_client.DatasetNameResponse( dataset_name=str(self.__dataset_name) ) @@ -86,7 +86,7 @@ def __init__(self, upload_id: UUID) -> None: self.__upload_id = upload_id @classmethod - def from_response(cls, response: geoengine_openapi_client.AddCollection200Response) -> UploadId: + def from_response(cls, response: geoengine_openapi_client.IdResponse) -> UploadId: '''Parse a http response to an `UploadId`''' return UploadId(UUID(response.id)) @@ -103,9 +103,9 @@ def __eq__(self, other) -> bool: return self.__upload_id == other.__upload_id # pylint: disable=protected-access - def to_api_dict(self) -> geoengine_openapi_client.AddCollection200Response: + def to_api_dict(self) -> geoengine_openapi_client.IdResponse: '''Converts the upload id to a dict for the api''' - return geoengine_openapi_client.AddCollection200Response( + return geoengine_openapi_client.IdResponse( id=str(self.__upload_id) ) diff --git a/geoengine/tasks.py b/geoengine/tasks.py index d80e2602..051b1af5 100644 --- a/geoengine/tasks.py +++ b/geoengine/tasks.py @@ -229,6 +229,7 @@ def get_status(self, timeout: int = 3600) -> TaskStatusInfo: with geoengine_openapi_client.ApiClient(session.configuration) as api_client: tasks_api = geoengine_openapi_client.TasksApi(api_client) + print(task_id_str) response = tasks_api.status_handler(task_id_str, _request_timeout=timeout) return TaskStatusInfo.from_response(response) diff --git a/geoengine/workflow.py b/geoengine/workflow.py index cb1fb935..92ccb27d 100644 --- a/geoengine/workflow.py +++ b/geoengine/workflow.py @@ -69,7 +69,7 @@ def __init__(self, workflow_id: UUID) -> None: self.__workflow_id = workflow_id @classmethod - def from_response(cls, response: geoengine_openapi_client.AddCollection200Response) -> WorkflowId: + def from_response(cls, response: geoengine_openapi_client.IdResponse) -> WorkflowId: ''' Create a `WorkflowId` from an http response ''' diff --git a/setup.cfg b/setup.cfg index 5a79755b..5a832f28 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,7 +18,7 @@ package_dir = packages = find: python_requires = >=3.9 install_requires = - geoengine-openapi-client == 0.0.21 + geoengine-openapi-client == 0.0.22 geopandas >=0.9,<0.15 matplotlib >=3.5,<3.8 numpy >=1.21,<2.1 @@ -33,7 +33,7 @@ install_requires = vega >= 3.5,<4 websockets >= 10.0,<11 xarray >=0.19,<2024.12 - urllib3 >= 2.0, < 2.3 + urllib3 >= 2.1, < 2.4 pydantic >= 2.10.6, < 2.11 skl2onnx >=1.17,<2 diff --git a/tests/test_tasks.py b/tests/test_tasks.py index ae6accab..9c89dcb8 100644 --- a/tests/test_tasks.py +++ b/tests/test_tasks.py @@ -244,7 +244,7 @@ def test_get_task_status(self): # Malformed malformed_status_task = Task(TaskId(UUID('ee4f1ed9-fd06-40be-90f5-d6289c154fcd'))) - with self.assertRaises(ValidationError): + with self.assertRaises(ValueError): malformed_status_task.get_status() def test_get_abort_task(self): diff --git a/tests/test_workflow_storage.py b/tests/test_workflow_storage.py index f15c27a4..b56a3bb4 100644 --- a/tests/test_workflow_storage.py +++ b/tests/test_workflow_storage.py @@ -21,7 +21,6 @@ def test_storing_workflow(self): "asCog": True, "description": "Bar", "displayName": "Foo", - "name": None, "query": { "spatialBounds": { "lowerRightCoordinate": { diff --git a/tests/util.py b/tests/util.py index ebf2cc6a..df0029ff 100644 --- a/tests/util.py +++ b/tests/util.py @@ -1,5 +1,6 @@ '''Utility methods for testing''' +import sys from unittest.mock import _patch, patch from json import dumps, loads import unittest @@ -7,6 +8,11 @@ import urllib3 +def eprint(*args, **kwargs): + '''Print to stderr''' + print(*args, file=sys.stderr, **kwargs) + + def is_url_match(url1: str, url2: str) -> bool: '''Checks if two urls point to the same resource''' parsed1 = urllib3.util.parse_url(url1) @@ -92,10 +98,10 @@ def _handle_request(self, method, url, *_args, **kwargs): body=matcher["body"] ) - # TODO: remove - print([matcher["url"] for matcher in self._matchers]) + # Note: Use for debgging + # eprint([matcher["url"] for matcher in self._matchers]) - print(f'No handler found for {method} {url}') + eprint(f'No handler found for {method} {url} with body {dumps(sent_body, indent=4)}') raise KeyError(f'No handler found for {method} {url}')