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.")