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

Bug with datetime values in timezone.utc #30

Closed
ajmarks opened this issue May 22, 2023 · 2 comments
Closed

Bug with datetime values in timezone.utc #30

ajmarks opened this issue May 22, 2023 · 2 comments
Labels

Comments

@ajmarks
Copy link

ajmarks commented May 22, 2023

The changes at bee8977 cause a ValueError (at mizani/utils.py:360) when with datetimes using timezone.utc. Repro:

from datetime import datetime, timezone
from mizani.utils import get_timezone

dt = datetime.now(tz=timezone.utc)
get_timezone([dt])
@ajmarks ajmarks changed the title Bug in timezone.utc Bug with datetime values in timezone.utc May 22, 2023
@repnant
Copy link

repnant commented May 25, 2023

Adding a fuller error message, as this was an extremly frustratingly non-google-able-bug, and it took me way too long too figure out that I needed to demote mizani to 0.8.1 when using plotnine

... mizani/utils.py", line 360, in get_timezone
    raise ValueError(f"Unrecognised timezone class {info.__class__}")
ValueError: Unrecognised timezone class <class 'datetime.timezone'>

@has2k1 has2k1 added the bug label May 25, 2023
has2k1 added a commit that referenced this issue May 25, 2023
@has2k1 has2k1 closed this as completed in fc21254 May 25, 2023
@has2k1
Copy link
Owner

has2k1 commented May 25, 2023

Fix has been released in mizani-0.9.2. Now on pypi and conda.

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

No branches or pull requests

3 participants