You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by jo...@apache.org on 2020/01/26 18:04:24 UTC
[incubator-superset] branch master updated: [refactor] Centralizing
custom Python types (#9026)
This is an automated email from the ASF dual-hosted git repository.
johnbodley pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new aecc82e [refactor] Centralizing custom Python types (#9026)
aecc82e is described below
commit aecc82e17480f3ed91b9d3ab281718d42603d442
Author: John Bodley <45...@users.noreply.github.com>
AuthorDate: Sun Jan 26 10:04:04 2020 -0800
[refactor] Centralizing custom Python types (#9026)
---
superset/typing.py | 3 ++-
superset/viz.py | 5 ++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/superset/typing.py b/superset/typing.py
index e716b4a..c297d23 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 8108cd1..cb383f3 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: