diff --git a/superset/typing.py b/superset/typing.py index e716b4a3977..c297d2338f7 100644 --- a/superset/typing.py +++ b/superset/typing.py @@ -14,9 +14,10 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -from typing import Any, Callable, Dict, Union +from typing import Any, Callable, Dict, List, Optional, Union from flask import Flask from flask_caching import Cache CacheConfig = Union[Callable[[Flask], Cache], Dict[str, Any]] +VizData = Optional[Union[List[Any], Dict[Any, Any]]] diff --git a/superset/viz.py b/superset/viz.py index 8108cd16787..cb383f333e2 100644 --- a/superset/viz.py +++ b/superset/viz.py @@ -32,7 +32,7 @@ from collections import defaultdict, OrderedDict from datetime import datetime, timedelta from functools import reduce from itertools import product -from typing import Any, Dict, List, Optional, Set, Tuple, TYPE_CHECKING, Union +from typing import Any, Dict, List, Optional, Set, Tuple, TYPE_CHECKING import geohash import numpy as np @@ -50,6 +50,7 @@ from superset import app, cache, get_css_manifest_files from superset.constants import NULL_STRING from superset.exceptions import NullValueException, SpatialException from superset.models.helpers import QueryResult +from superset.typing import VizData from superset.utils import core as utils from superset.utils.core import ( DTTM_ALIAS, @@ -77,8 +78,6 @@ METRIC_KEYS = [ "size", ] -VizData = Optional[Union[List[Any], Dict[Any, Any]]] - class BaseViz: