Skip to content

Commit

Permalink
Upgrade packages and pygeoapi
Browse files Browse the repository at this point in the history
  • Loading branch information
totycro committed Mar 18, 2024
1 parent 492f5fd commit df1406f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.1.12
* Upgrade underlying pygeoapi to current version

## 1.1.11
* Send 400 error with message for client errors

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/eurodatacube/pygeoapi:latest-20240117
FROM eurodatacube/pygeoapi:latest-20240318

RUN apt update \
&& apt --no-install-recommends -y install patch vim-tiny
Expand Down
43 changes: 20 additions & 23 deletions allow-specifying-job_id-via-request-parameter.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 8670cc0997b376a3afcfdc157fbb13d1d81f7be8 Mon Sep 17 00:00:00 2001
From b7c955c9ef684bc152e8c44005f5f5df22f79b0f Mon Sep 17 00:00:00 2001
From: Bernhard Mallinger <[email protected]>
Date: Wed, 12 Jul 2023 10:45:55 +0200
Subject: [PATCH] Allow specifying `job_id` via request parameter
Expand All @@ -14,46 +14,43 @@ so I'd prefer to pass the id via POST data. This way we can treat it as
suggestion, or possibly as a template from which the server derives the
actual id.
---
pygeoapi/api.py | 3 ++-
pygeoapi/process/manager/base.py | 5 +++--
2 files changed, 5 insertions(+), 3 deletions(-)
pygeoapi/api.py | 2 ++
pygeoapi/process/manager/base.py | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)

diff --git pygeoapi/api.py pygeoapi/api.py
index e388275..b5449fa 100644
index 899f5ea..f410cd8 100644
--- pygeoapi/api.py
+++ pygeoapi/api.py
@@ -3552,6 +3552,7 @@ class API:
@@ -3492,6 +3492,7 @@ class API:

data_dict = data.get('inputs', {})
LOGGER.debug(data_dict)
+ desired_job_id = data.get("job_id")

try:
execution_mode = RequestedProcessExecutionMode(
@@ -3562,7 +3563,7 @@ class API:
try:
LOGGER.debug('Executing process')
result = self.manager.execute_process(
- process_id, data_dict, execution_mode=execution_mode)
+ process_id, data_dict, execution_mode=execution_mode, desired_job_id=desired_job_id)
subscriber = None
subscriber_dict = data.get('subscriber')
@@ -3523,6 +3524,7 @@ class API:
data_dict,
execution_mode=execution_mode,
subscriber=subscriber,
+ desired_job_id=desired_job_id,
)
job_id, mime_type, outputs, status, additional_headers = result
headers.update(additional_headers or {})
headers['Location'] = f'{self.base_url}/jobs/{job_id}'
diff --git pygeoapi/process/manager/base.py pygeoapi/process/manager/base.py
index d0d7824..0f6d35a 100644
index 3149e73..1c80abd 100644
--- pygeoapi/process/manager/base.py
+++ pygeoapi/process/manager/base.py
@@ -312,7 +312,8 @@ class BaseManager:
self,
process_id: str,
@@ -328,6 +328,7 @@ class BaseManager:
data_dict: dict,
- execution_mode: Optional[RequestedProcessExecutionMode] = None
+ execution_mode: Optional[RequestedProcessExecutionMode] = None,
+ desired_job_id: str | None = None
execution_mode: Optional[RequestedProcessExecutionMode] = None,
subscriber: Optional[Subscriber] = None,
+ desired_job_id: str | None = None,
) -> Tuple[str, Any, JobStatus, Optional[Dict[str, str]]]:
"""
Default process execution handler
@@ -329,7 +330,7 @@ class BaseManager:
@@ -345,7 +346,7 @@ class BaseManager:
response
"""

Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ scrapbook==0.5.0
typed_json_dataclass==1.2.1
requests==2.31.0
# need to upgrade from base image for papermill dependency
python-dateutil==2.8.2
python-dateutil==2.9.0

pytest
pytest-watch
flake8==7.0.0
mypy==1.8.0
black==23.12.1
mypy==1.9.0
black==24.3.0
types-requests
types-PyYAML

0 comments on commit df1406f

Please sign in to comment.