Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/.backend_git_ref
Original file line number Diff line number Diff line change
@@ -1 +1 @@
35bae875265258dfacb8c9103e6967c7c934406a
af126cb150c974cf47a52d2fac5b4a96a81d2c77
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2,286 changes: 2,286 additions & 0 deletions deps.txt

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions geoengine/resource_identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
)

Expand All @@ -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))

Expand All @@ -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)
)

Expand Down
1 change: 1 addition & 0 deletions geoengine/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion geoengine/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
'''
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package_dir =
packages = find:
python_requires = >=3.9
install_requires =
geoengine-openapi-client == 0.0.21
geoengine-openapi-client @ git+https://github.com/geo-engine/openapi-client@update-openapi-generator#subdirectory=python # TODO update when merged
geopandas >=0.9,<0.15
matplotlib >=3.5,<3.8
numpy >=1.21,<2.1
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 0 additions & 1 deletion tests/test_workflow_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def test_storing_workflow(self):
"asCog": True,
"description": "Bar",
"displayName": "Foo",
"name": None,
"query": {
"spatialBounds": {
"lowerRightCoordinate": {
Expand Down
12 changes: 9 additions & 3 deletions tests/util.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
'''Utility methods for testing'''

import sys
from unittest.mock import _patch, patch
from json import dumps, loads
import unittest
from urllib.parse import parse_qs
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)
Expand Down Expand Up @@ -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}')

Expand Down