Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle default temporal extent specifically in load_stac #330

Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ and start a new "In Progress" section above it.

## In progress

- NDVI process: correctly handle band dimension as part of dry run
- NDVI process: correctly handle band dimension as part of dry run

## 0.119.0

- `load_stac`: allow omitting `datetime` parameter from STAC API item search request if no `temporal_extent` specified ([Open-EO/openeo-geopyspark-driver#950](https://github.com/Open-EO/openeo-geopyspark-driver/issues/950))

## 0.118.0

Expand Down
4 changes: 3 additions & 1 deletion openeo_driver/ProcessGraphDeserializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
from openeo_driver.util.utm import auto_utm_epsg_for_geometry
from openeo_driver.utils import EvalEnv, smart_bool

DEFAULT_TEMPORAL_EXTENT = ["1970-01-01", "2070-01-01"] # also a sentinel value for load_stac

_log = logging.getLogger(__name__)

# Set up process registries (version dependent)
Expand Down Expand Up @@ -582,7 +584,7 @@ def _extract_load_parameters(env: EvalEnv, source_id: tuple) -> LoadParameters:
source_constraints.remove((source_id,constraints)) # Side effect!

params = LoadParameters()
params.temporal_extent = constraints.get("temporal_extent", ["1970-01-01", "2070-01-01"])
params.temporal_extent = constraints.get("temporal_extent", DEFAULT_TEMPORAL_EXTENT)
labels_args = constraints.get("filter_labels", {})
if("dimension" in labels_args and labels_args["dimension"] == "t"):
params.filter_temporal_labels = labels_args.get("condition")
Expand Down
2 changes: 1 addition & 1 deletion openeo_driver/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.118.0a1"
__version__ = "0.119.0a1"
14 changes: 14 additions & 0 deletions tests/test_views_execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -4148,6 +4148,20 @@ def test_synchronous_processing_request_costs(
)


def test_load_stac_default_temporal_extent(api, backend_implementation):
with mock.patch.object(backend_implementation, "load_stac") as load_stac:
api.ensure_auth_header()
pg = {"loadstac1": {"process_id": "load_stac", "arguments": {"url": "https://stac.test"}, "result": True}}
post_data = {
"process": {"process_graph": pg},
}
api.post(path="/result", json=post_data)

assert load_stac.call_count == 1
_, kwargs = load_stac.call_args

assert kwargs["load_params"]["temporal_extent"] == ["1970-01-01", "2070-01-01"]


class TestVectorCubeRunUDF:
"""
Expand Down