Skip to content

Commit

Permalink
fix: don't use py 3.10 unions yet
Browse files Browse the repository at this point in the history
  • Loading branch information
fubuloubu committed Apr 17, 2024
1 parent a7be986 commit 55d89ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion silverback/recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ async def add_result(self, result: TaskResult):
writer.write("\n")


def get_metrics(session: Path | str, task_name: str) -> Iterator[dict]:
def get_metrics(session: Path, task_name: str) -> Iterator[dict]:
with open(session, "r") as file:
for line in file:
if (
Expand Down
4 changes: 2 additions & 2 deletions silverback/types.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import datetime, timezone
from decimal import Decimal
from enum import Enum # NOTE: `enum.StrEnum` only in Python 3.11+
from typing import Annotated, Literal
from typing import Annotated, Literal, Union

from pydantic import BaseModel, Field
from pydantic.functional_serializers import PlainSerializer
Expand Down Expand Up @@ -63,7 +63,7 @@ class _BaseDatapoint(BaseModel):


# NOTE: only these types of data are implicitly converted e.g. `{"something": 1, "else": 0.001}`
ScalarType = bool | int | float | Decimal
ScalarType = Union[bool, int, float, Decimal]


class ScalarDatapoint(_BaseDatapoint):
Expand Down

0 comments on commit 55d89ad

Please sign in to comment.