Skip to content

Commit

Permalink
Issue #84: Cleanup left over from workaround that forces sentinelhub …
Browse files Browse the repository at this point in the history
…for secondary service creation
  • Loading branch information
JohanKJSchreurs committed Dec 12, 2022
1 parent ded38cc commit 5e8b3f9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/openeo_aggregator/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ def service_types(self) -> dict:
return {name: data["service_type"] for name, data, in cached_info.items()}

def _find_backend_id_for_service_type(self, service_type: str) -> str:
"""Returns the ID of the backend that provides the service_type or None if no backend supports that service."""
"""Returns the ID of the backend that provides the service_type."""
cached_info = self._get_service_types_cached()
backend_id = cached_info.get(service_type, {}).get("backend_id")
if backend_id is None:
Expand Down Expand Up @@ -800,16 +800,13 @@ def service_info(self, user_id: str, service_id: str) -> ServiceMetadata:
service_json["id"] = ServiceIdMapping.get_aggregator_service_id(service_json["id"], con.id)
return ServiceMetadata.from_dict(service_json)

def create_service(self, user_id: str, process_graph: dict, service_type: str, api_version: str,
def _create_service(self, user_id: str, process_graph: dict, service_type: str, api_version: str,
configuration: dict) -> str:
"""
https://openeo.org/documentation/1.0/developers/api/reference.html#operation/create-service
"""
# TODO: configuration is not used. What to do with it?

# TODO: Strictly speaking it would be better to override _create_service instead of create_service
# but for now we override create_service so we can keep the special case for the "sentinelhub" backend.

backend_id = self._find_backend_id_for_service_type(service_type)
process_graph = self._processing.preprocess_process_graph(process_graph, backend_id=backend_id)

Expand Down

0 comments on commit 5e8b3f9

Please sign in to comment.