From 0a68bc634d593c94e6c76fc46a788e66250a8dc3 Mon Sep 17 00:00:00 2001 From: "Kathryn (Kat) Wicks" Date: Mon, 17 Jun 2024 17:45:52 -0700 Subject: [PATCH] use old mypy syntax --- cleanlab_studio/errors.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cleanlab_studio/errors.py b/cleanlab_studio/errors.py index 2301321e..a3289be4 100644 --- a/cleanlab_studio/errors.py +++ b/cleanlab_studio/errors.py @@ -1,5 +1,6 @@ from asyncio import Handle import pathlib +from mypy import Union class HandledError(Exception): @@ -141,7 +142,7 @@ class InvalidProjectConfiguration(HandledError): class InvalidFilepathError(HandledError): - def __init__(self, filepath: str | pathlib.Path = "") -> None: + def __init__(self, filepath: Union[str, pathlib.Path] = "") -> None: if isinstance(filepath, pathlib.Path): filepath = str(filepath) super().__init__(f"File could not be found at {filepath}. Please check the file path.")