From f239bad05e893a1fff15ea8a261da9b7e80f155d Mon Sep 17 00:00:00 2001 From: Rushil Srivastava Date: Tue, 9 Jan 2024 04:43:19 -0800 Subject: [PATCH 1/2] :bug: Add UUID serialization --- axiom/util.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) From 8b0321e1c0e7975f1e16739b58f41f5e8e859076 Mon Sep 17 00:00:00 2001 From: Rushil Srivastava Date: Tue, 9 Jan 2024 04:43:26 -0800 Subject: [PATCH 2/2] :see_no_evil: Add jetbrains --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) 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