Skip to content

Commit ccd064f

Browse files
committed
fixup! Issue #666 load_stac: fallback temporal dimension when no cube:dimensions
1 parent 4de8c61 commit ccd064f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

openeo/util.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ def parse_date_or_datetime(
172172
@classmethod
173173
def _format_datetime(cls, d: dt.datetime) -> str:
174174
"""Format given datetime as RFC-3339 date-time string."""
175-
if d.tzinfo not in {None, dt.timezone.utc}:
175+
import dateutil
176+
177+
if not (d.tzinfo is None or d.tzinfo.tzname(d) == "UTC"):
176178
# TODO: add support for non-UTC timezones?
177179
raise ValueError(f"No support for non-UTC timezone {d.tzinfo}")
178180
return d.strftime(cls._FMT_DATETIME)

tests/test_metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ def test_metadata_from_stac_collection_bands_from_item_assets(test_data, tmp_pat
868868
),
869869
(
870870
StacDummyBuilder.collection(),
871-
None,
871+
("t", ["2024-01-01T00:00:00Z", "2024-05-05T00:00:00Z"]),
872872
),
873873
(
874874
StacDummyBuilder.collection(

0 commit comments

Comments
 (0)