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

API Query doctest fails due to different timezone representation #1485

Closed
agware opened this issue Aug 21, 2023 · 0 comments · Fixed by #1527
Closed

API Query doctest fails due to different timezone representation #1485

agware opened this issue Aug 21, 2023 · 0 comments · Fixed by #1527

Comments

@agware
Copy link

agware commented Aug 21, 2023

Expected behaviour

The API query doctest should pass where the timezone is UTC regardless of representation

Actual behaviour

The doctest fails due to a returned representation of datetime.timezone.utc instead of <UTC>

Steps to reproduce the behaviour

Run ./datacube/api/query.py::datacube.api.query.Query.__init__ in local environment. Test passes when run --with-docker

>>> query.search_terms['time']  # doctest: +NORMALIZE_WHITESPACE
Expected:
    Range(begin=datetime.datetime(2001, 1, 1, 0, 0, tzinfo=<UTC>),         end=datetime.datetime(2002, 1, 1, 23, 59, 59, 999999, tzinfo=tzutc()))
Got:
    Range(begin=datetime.datetime(2001, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), end=datetime.datetime(2002, 1, 1, 23, 59, 59, 999999, tzinfo=tzutc()))

Environment information

python == 3.11.4
pytest == 7.4.0

Open Data Cube core, version 1.8.16.dev4+g24b046e7
Ubuntu 22.04.3 LTS

Note: Stale issues will be automatically closed after a period of six months with no activity.
To ensure critical issues are not closed, tag them with the Github pinned tag.
If you are a community member and not a maintainer please escalate this issue to maintainers via
GIS StackExchange or Slack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant