Skip to content

Commit

Permalink
fix(type): get_args still needed for union check
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeshultz committed May 4, 2024
1 parent 9717ac0 commit 2920b39
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions silverback/recorder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Any, Iterator
from typing import Any, Iterator, get_args

from ape.logging import get_logger
from pydantic import BaseModel, Field
Expand Down Expand Up @@ -43,7 +43,7 @@ def _extract_custom_metrics(cls, result: Any, task_name: str) -> dict[str, Datap
if isinstance(result, Datapoint): # type: ignore[arg-type,misc]
return {"result": result}

elif isinstance(result, ScalarType):
elif isinstance(result, get_args(ScalarType)):
if isinstance(result, int) and not (INT96_RANGE[0] <= result <= INT96_RANGE[1]):
logger.warn("Result integer is out of range suitable for parquet. Ignoring.")
else:
Expand Down

0 comments on commit 2920b39

Please sign in to comment.