diff --git a/.gitignore b/.gitignore index 698cb7e..62f14c5 100644 --- a/.gitignore +++ b/.gitignore @@ -134,6 +134,9 @@ poetry.lock # VSCode .vscode/ +# JetBrains +.idea/ + # Direnv /.envrc /.direnv diff --git a/axiom/util.py b/axiom/util.py index 443ee98..3874f2b 100644 --- a/axiom/util.py +++ b/axiom/util.py @@ -1,6 +1,7 @@ import dacite import iso8601 from enum import Enum +from uuid import UUID from typing import Type, TypeVar from datetime import datetime, timedelta @@ -66,9 +67,10 @@ def convert_string_to_timedelta(cls, val: str) -> timedelta: @classmethod def handle_json_serialization(cls, obj): if isinstance(obj, datetime): - d = obj.isoformat("T") + "Z" - return d + return obj.isoformat("T") + "Z" elif isinstance(obj, timedelta): return str(obj.seconds) + "s" elif isinstance(obj, Enum): return obj.value + elif isinstance(obj, UUID): + return str(obj)