Browse Source

made TypedDict import compatible with python < 3.8

tanja 3 years ago
parent
commit
db6b97772a
2 changed files with 8 additions and 2 deletions
  1. 1 1
      Pipfile.lock
  2. 7 1
      cdplib/pipeline_selector/PipelineSelector.py

+ 1 - 1
Pipfile.lock

@@ -26,7 +26,7 @@
         "cdplib": {
         "cdplib": {
             "editable": true,
             "editable": true,
             "git": "https://readonly:readonly@intra.acdp.at/gogs/tanja/cdplib.git",
             "git": "https://readonly:readonly@intra.acdp.at/gogs/tanja/cdplib.git",
-            "ref": "ce7201d0103a1170d8efe42f7d59c75d1c1f433e"
+            "ref": "362220280f6768abda363240b5fce51eb4d9016e"
         },
         },
         "certifi": {
         "certifi": {
             "hashes": [
             "hashes": [

+ 7 - 1
cdplib/pipeline_selector/PipelineSelector.py

@@ -26,8 +26,14 @@ import numpy as np
 import pandas as pd
 import pandas as pd
 from copy import deepcopy
 from copy import deepcopy
 from abc import ABC, abstractmethod, abstractproperty
 from abc import ABC, abstractmethod, abstractproperty
-from typing import Callable, TypedDict,\
+
+if sys.version_info >= (3, 8):
+    from typing import Callable, TypedDict,\
+    Literal, Dict, Iterable, List, Tuple, Union
+else:
+    from typing_extensions import Callable, TypedDict,\
     Literal, Dict, Iterable, List, Tuple, Union
     Literal, Dict, Iterable, List, Tuple, Union
+
 import functools
 import functools
 from sklearn.pipeline import Pipeline
 from sklearn.pipeline import Pipeline
 from sklearn.model_selection import cross_validate as sklearn_cross_validation
 from sklearn.model_selection import cross_validate as sklearn_cross_validation