Open-EO / openeo-python-client

Python client API for OpenEO
https://open-eo.github.io/openeo-python-client/
Apache License 2.0
156 stars 42 forks source link

Shorthand temporal extent support issue with filter_temporal #628

Closed soxofaan closed 1 month ago

soxofaan commented 2 months ago

"shorthand" temporal support documented at https://open-eo.github.io/openeo-python-client/data_access.html#single-string-temporal-extents

I wanted to use the shorthand "month" support with filter_temporal, and used:

cube = connection.load_collection("SENTINEL2_L2A")
cube = cube.filter_temporal("2021-08")

Which apparently gives for filter_temporal:

"extent": [
          "2021-08-01",
          null
        ]

I should have used

cube = cube.filter_temporal(extent="2021-08")

Which gives

"extent": [
          "2021-08-01",
          "2021-09-01"
        ]

It's easy to get this wrong (which has big impact), so we better at least show a warning about the ambiguity