Skip to content

Commit

Permalink
Initial support for job_options handling in `OpenEoBackendImplement…
Browse files Browse the repository at this point in the history
…ation.request_costs()`

ref #531, eu-cdse/openeo-cdse-infra#114
  • Loading branch information
soxofaan committed May 2, 2024
1 parent 37e95cd commit 34474f8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ without compromising stable operations.

## Unreleased

## 0.31.1

- Initial support for `job_options` handling in `OpenEoBackendImplementation.request_costs()`
([#531](https://github.com/Open-EO/openeo-geopyspark-driver/issues/531), eu-cdse/openeo-cdse-infra#114)

## 0.31.0

- vector_to_raster now returns a valid raster cube ([#273](https://github.com/Open-EO/openeo-python-driver/issues/273))
Expand Down
2 changes: 1 addition & 1 deletion openeogeotrellis/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.31.0a1"
__version__ = "0.31.1a1"
10 changes: 9 additions & 1 deletion openeogeotrellis/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,14 @@ def set_default_sentinel_hub_credentials(self, client_id: str, client_secret: st
def set_terrascope_access_token_getter(self, get_terrascope_access_token: Callable[[User, str], str]):
self.batch_jobs.set_terrascope_access_token_getter(get_terrascope_access_token)

def request_costs(self, *, user: User, request_id: str, success: bool) -> Optional[float]:
def request_costs(
self,
*,
user: User,
job_options: Union[dict, None] = None,
request_id: str,
success: bool,
) -> Optional[float]:
"""Get resource usage cost associated with (current) synchronous processing request."""

user_id = user.user_id
Expand All @@ -1158,6 +1165,7 @@ def request_costs(self, *, user: User, request_id: str, success: bool) -> Option

etl_api = get_etl_api(
user=user,
job_options=job_options,
allow_dynamic_etl_api=bool(
# TODO #531 this is temporary feature flag, to removed when done
backend_config.etl_dynamic_api_flag
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
tests_require=tests_require,
install_requires=[
"openeo>=0.15.0",
"openeo_driver>=0.97.0.dev",
"openeo_driver>=0.98.0.dev",
'pyspark==3.4.2; python_version>="3.8"',
'pyspark>=2.3.1,<2.4.0; python_version<"3.8"',
'geopyspark==0.4.7+openeo',
Expand Down

0 comments on commit 34474f8

Please sign in to comment.