Skip to content

Commit 89c260a

Browse files
Merge pull request #220 from geo-engine/openapi-client-0.22
adjust for openapi-client v0.0.22
2 parents 266a0dc + 31178cd commit 89c260a

File tree

9 files changed

+23
-17
lines changed

9 files changed

+23
-17
lines changed

.github/.backend_git_ref

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
35bae875265258dfacb8c9103e6967c7c934406a
1+
af126cb150c974cf47a52d2fac5b4a96a81d2c77

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212

1313
jobs:
1414
check:
15-
uses: geo-engine/geoengine-python/.github/workflows/test-python.yml@ubuntu-24
15+
uses: geo-engine/geoengine-python/.github/workflows/test-python.yml@main
1616

1717
strategy:
1818
fail-fast: false
@@ -28,7 +28,7 @@ jobs:
2828
# Checks the library using minimum version resolution
2929
# `uv` has this feature built-in, c.f. https://github.com/astral-sh/uv
3030
check-min-version:
31-
uses: geo-engine/geoengine-python/.github/workflows/test-python.yml@ubuntu-24
31+
uses: geo-engine/geoengine-python/.github/workflows/test-python.yml@main
3232

3333
with:
3434
python-version: 3.9

geoengine/resource_identifier.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(self, dataset_name: str) -> None:
5454
self.__dataset_name = dataset_name
5555

5656
@classmethod
57-
def from_response(cls, response: geoengine_openapi_client.CreateDatasetHandler200Response) -> DatasetName:
57+
def from_response(cls, response: geoengine_openapi_client.DatasetNameResponse) -> DatasetName:
5858
'''Parse a http response to an `DatasetName`'''
5959
return DatasetName(response.dataset_name)
6060

@@ -71,8 +71,8 @@ def __eq__(self, other) -> bool:
7171

7272
return self.__dataset_name == other.__dataset_name # pylint: disable=protected-access
7373

74-
def to_api_dict(self) -> geoengine_openapi_client.CreateDatasetHandler200Response:
75-
return geoengine_openapi_client.CreateDatasetHandler200Response(
74+
def to_api_dict(self) -> geoengine_openapi_client.DatasetNameResponse:
75+
return geoengine_openapi_client.DatasetNameResponse(
7676
dataset_name=str(self.__dataset_name)
7777
)
7878

@@ -86,7 +86,7 @@ def __init__(self, upload_id: UUID) -> None:
8686
self.__upload_id = upload_id
8787

8888
@classmethod
89-
def from_response(cls, response: geoengine_openapi_client.AddCollection200Response) -> UploadId:
89+
def from_response(cls, response: geoengine_openapi_client.IdResponse) -> UploadId:
9090
'''Parse a http response to an `UploadId`'''
9191
return UploadId(UUID(response.id))
9292

@@ -103,9 +103,9 @@ def __eq__(self, other) -> bool:
103103

104104
return self.__upload_id == other.__upload_id # pylint: disable=protected-access
105105

106-
def to_api_dict(self) -> geoengine_openapi_client.AddCollection200Response:
106+
def to_api_dict(self) -> geoengine_openapi_client.IdResponse:
107107
'''Converts the upload id to a dict for the api'''
108-
return geoengine_openapi_client.AddCollection200Response(
108+
return geoengine_openapi_client.IdResponse(
109109
id=str(self.__upload_id)
110110
)
111111

geoengine/tasks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ def get_status(self, timeout: int = 3600) -> TaskStatusInfo:
229229

230230
with geoengine_openapi_client.ApiClient(session.configuration) as api_client:
231231
tasks_api = geoengine_openapi_client.TasksApi(api_client)
232+
print(task_id_str)
232233
response = tasks_api.status_handler(task_id_str, _request_timeout=timeout)
233234

234235
return TaskStatusInfo.from_response(response)

geoengine/workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def __init__(self, workflow_id: UUID) -> None:
6969
self.__workflow_id = workflow_id
7070

7171
@classmethod
72-
def from_response(cls, response: geoengine_openapi_client.AddCollection200Response) -> WorkflowId:
72+
def from_response(cls, response: geoengine_openapi_client.IdResponse) -> WorkflowId:
7373
'''
7474
Create a `WorkflowId` from an http response
7575
'''

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ package_dir =
1818
packages = find:
1919
python_requires = >=3.9
2020
install_requires =
21-
geoengine-openapi-client == 0.0.21
21+
geoengine-openapi-client == 0.0.22
2222
geopandas >=0.9,<0.15
2323
matplotlib >=3.5,<3.8
2424
numpy >=1.21,<2.1
@@ -33,7 +33,7 @@ install_requires =
3333
vega >= 3.5,<4
3434
websockets >= 10.0,<11
3535
xarray >=0.19,<2024.12
36-
urllib3 >= 2.0, < 2.3
36+
urllib3 >= 2.1, < 2.4
3737
pydantic >= 2.10.6, < 2.11
3838
skl2onnx >=1.17,<2
3939

tests/test_tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def test_get_task_status(self):
244244

245245
# Malformed
246246
malformed_status_task = Task(TaskId(UUID('ee4f1ed9-fd06-40be-90f5-d6289c154fcd')))
247-
with self.assertRaises(ValidationError):
247+
with self.assertRaises(ValueError):
248248
malformed_status_task.get_status()
249249

250250
def test_get_abort_task(self):

tests/test_workflow_storage.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ def test_storing_workflow(self):
2121
"asCog": True,
2222
"description": "Bar",
2323
"displayName": "Foo",
24-
"name": None,
2524
"query": {
2625
"spatialBounds": {
2726
"lowerRightCoordinate": {

tests/util.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
'''Utility methods for testing'''
22

3+
import sys
34
from unittest.mock import _patch, patch
45
from json import dumps, loads
56
import unittest
67
from urllib.parse import parse_qs
78
import urllib3
89

910

11+
def eprint(*args, **kwargs):
12+
'''Print to stderr'''
13+
print(*args, file=sys.stderr, **kwargs)
14+
15+
1016
def is_url_match(url1: str, url2: str) -> bool:
1117
'''Checks if two urls point to the same resource'''
1218
parsed1 = urllib3.util.parse_url(url1)
@@ -92,10 +98,10 @@ def _handle_request(self, method, url, *_args, **kwargs):
9298
body=matcher["body"]
9399
)
94100

95-
# TODO: remove
96-
print([matcher["url"] for matcher in self._matchers])
101+
# Note: Use for debgging
102+
# eprint([matcher["url"] for matcher in self._matchers])
97103

98-
print(f'No handler found for {method} {url}')
104+
eprint(f'No handler found for {method} {url} with body {dumps(sent_body, indent=4)}')
99105

100106
raise KeyError(f'No handler found for {method} {url}')
101107

0 commit comments

Comments
 (0)