diff --git a/darts/timeseries.py b/darts/timeseries.py index 1f49f1d1a1..7eca55eb94 100644 --- a/darts/timeseries.py +++ b/darts/timeseries.py @@ -37,7 +37,7 @@ from collections import defaultdict from copy import deepcopy from inspect import signature -from typing import Any, Callable, Dict, List, Literal, Optional, Sequence, Tuple, Union +from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union import matplotlib.pyplot as plt import numpy as np @@ -48,6 +48,11 @@ from .logging import get_logger, raise_if, raise_if_not, raise_log +try: + from typing import Literal +except ImportError: + from typing_extensions import Literal + logger = get_logger(__name__) # dimension names in the DataArray