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

chore: utcfromtimestamp is deprecated in python 3.12. #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions chaosreport/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
import subprocess
import tempfile
from base64 import b64encode
from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone
from functools import partial
from typing import Any, Dict, List

import cairosvg
Expand Down Expand Up @@ -464,7 +465,7 @@ def generate_chart_from_prometheus(run: Run, export_format: str):
# now we have our range of abscissa, let's map those
# timestamps to formatted strings
x = sorted(list(x))
fromts = datetime.utcfromtimestamp
fromts = partial(datetime.fromtimestamp, tz=timezone.utc)
chart.x_labels = [
fromts(v).strftime("%Y-%m-%d\n %H:%M:%S") for v in x
]
Expand Down
Loading