You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following warning appears when the server is serving tiles to the viewer:
xcube/xcube/core/_tile2.py:659: DeprecationWarning: parsing timezone aware datetimes is deprecated; this will raise an error in the future
To Reproduce
Start an xcube viewer and server, including the --warnings flag to the server to display warnings. Perform some typical user activities in the viewer (pan, zoom, etc.). The warning will appear in the server log output.
Expected behavior
It is expected that this warning will not appear.
Additional context
While this bug currently has no consequences beyond the warning, xcube does not set an upper limit on the numpy version in its dependencies. Therefore any future numpy release may upgrade this warning to an error and break all xcube server installs from that moment onward.
The error occurs because the viewer requests a tile with a timezone-aware datestamp (Z suffix) -- see #605 for more on this. While this might be considered incorrect in cases where the time dimension of the data is timezone-naive, the server should in any case be able to handle both timezone-naive and timezone-aware datestamps.
The warning can be reproduced in isolation like this:
Probably the most sensible fix is to do a specific check in the _tile2 module for this particular case (datetime64 target type, timezone-aware string), convert to UTC, and force to naive -- in effect reproducing the old behaviour of numpy.
The text was updated successfully, but these errors were encountered:
The warning type and message have now changed: it's now "UserWarning: no explicit representation of timezones available for np.datetime64". See numpy/numpy#23904 and numpy/numpy#24193 for details.
Also, xcube/xcube/core/_tile2.py, where the warning originates, has been renamed to tile.py.
Describe the bug
The following warning appears when the server is serving tiles to the viewer:
To Reproduce
Start an xcube viewer and server, including the
--warnings
flag to the server to display warnings. Perform some typical user activities in the viewer (pan, zoom, etc.). The warning will appear in the server log output.Expected behavior
It is expected that this warning will not appear.
Additional context
While this bug currently has no consequences beyond the warning, xcube does not set an upper limit on the numpy version in its dependencies. Therefore any future numpy release may upgrade this warning to an error and break all xcube server installs from that moment onward.
The error occurs because the viewer requests a tile with a timezone-aware datestamp (Z suffix) -- see #605 for more on this. While this might be considered incorrect in cases where the time dimension of the data is timezone-naive, the server should in any case be able to handle both timezone-naive and timezone-aware datestamps.
The warning can be reproduced in isolation like this:
Probably the most sensible fix is to do a specific check in the
_tile2
module for this particular case (datetime64 target type, timezone-aware string), convert to UTC, and force to naive -- in effect reproducing the old behaviour of numpy.The text was updated successfully, but these errors were encountered: