From b81db0a1ab8b4d8afe485a8a1922581eb3f9f771 Mon Sep 17 00:00:00 2001 From: dennisbader Date: Wed, 28 Dec 2022 10:59:26 +0100 Subject: [PATCH] fix Literal import for python37 --- darts/timeseries.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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