From 03b2ee98a1a2da648684e5a1a02c7f8c5b45ddd8 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 24 Sep 2024 10:31:48 -0500 Subject: typing: Fix type errors --- uploader/datautils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'uploader/datautils.py') diff --git a/uploader/datautils.py b/uploader/datautils.py index 2ee079d..46a55c4 100644 --- a/uploader/datautils.py +++ b/uploader/datautils.py @@ -1,7 +1,7 @@ """Generic data utilities: Rename module.""" import math -from typing import Sequence from functools import reduce +from typing import Union, Sequence def enumerate_sequence(seq: Sequence[dict], start:int = 1) -> Sequence[dict]: """Enumerate sequence beginning at 1""" @@ -28,7 +28,7 @@ def order_by_family(items: tuple[dict, ...], key=lambda item: item[0][0]) -def safe_int(val: str) -> int: +def safe_int(val: Union[str, int, float]) -> int: """ Convert val into an integer: if val cannot be converted, return a zero. """ -- cgit v1.2.3