Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[refactor] Centralizing custom Python types #9026

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion superset/typing.py
Expand Up @@ -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]]]
5 changes: 2 additions & 3 deletions superset/viz.py
Expand Up @@ -32,7 +32,7 @@
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
Expand All @@ -50,6 +50,7 @@
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,
Expand Down Expand Up @@ -77,8 +78,6 @@
"size",
]

VizData = Optional[Union[List[Any], Dict[Any, Any]]]


class BaseViz:

Expand Down