ZGIS / semantique

Semantic Querying in Earth Observation Data Cubes
https://zgis.github.io/semantique/
Apache License 2.0
16 stars 6 forks source link

inferences fail with timezone error #25

Closed whisperingpixel closed 1 year ago

whisperingpixel commented 1 year ago

Description

With an installation as of today (updated from March), inferences fail with the following error:

image

Logfile:

2023-05-12 17:25:53,008 inference    INFO     Factbase sen2cube (inference id_65622): Inference finished.
    "tz": start.tz.zone
  File "/usr/local/lib/python3.8/dist-packages/semantique/extent.py", line 277, in __init__
    sq_time = sq.TemporalExtent(start, end)
  File "/usr/semanticeodatacube/infer.py", line 751, in prepare_inference
Traceback (most recent call last):
2023-05-12 17:25:53,008 inference    CRITICAL ('Factbase %s (inference id_%s): Inference failed: %s', 'sen2cube', 65622, AttributeError("'datetime.timezone' object has no attribute 'zone'"))

Reproducible example

n.a.

Expected behavior

n.a.

Environment information

Sen2Cube.at

Additional context

This has occurred after an update today - potentially due to an updated dependency.

whisperingpixel commented 1 year ago

Update: This seems to happen only if there is no timezone via pytz set. 7682ed3 fixes this in Sen2Cube.at but I'll keep this open because it either requires a documentation or a default value ... It's still unclear to me why this happens after the update (but without changing semantique or the associated Sen2Cube.at code)

luukvdmeer commented 1 year ago

Pandas has updated timezone behaviour. If I understand correctly, they now use different libraries to represent UTC/fixed UTC offsets and other types of timezones. Rather confusing, but we have to deal with it I guess.. See https://pandas.pydata.org/docs/whatsnew/v2.0.0.html#utc-and-fixed-offset-timezones-default-to-standard-library-tzinfo-objects

luukvdmeer commented 1 year ago

This should be fixed now with the commits referenced above. Please re-open if problems remain on the Sen2Cube side