diff --git a/caravel/config.py b/caravel/config.py index 93930cc1b284..18c9d5c69f06 100644 --- a/caravel/config.py +++ b/caravel/config.py @@ -121,6 +121,15 @@ CACHE_DEFAULT_TIMEOUT = None CACHE_CONFIG = {'CACHE_TYPE': 'null'} + +# --------------------------------------------------- +# List of viz_types not allowed in your environment +# For example: Blacklist pivot table and treemap: +# VIZ_TYPE_BLACKLIST = ['pivot_table', 'treemap'] +# --------------------------------------------------- + +VIZ_TYPE_BLACKLIST = [] + try: from caravel_config import * # noqa except Exception: diff --git a/caravel/viz.py b/caravel/viz.py index 9d5f56fc4fba..2765244f9e03 100644 --- a/caravel/viz.py +++ b/caravel/viz.py @@ -14,7 +14,6 @@ import uuid from collections import OrderedDict, defaultdict from datetime import datetime, timedelta - import pandas as pd import numpy as np from flask import flash, request, Markup @@ -1540,4 +1539,5 @@ def get_data(self): TreemapViz, ] -viz_types = OrderedDict([(v.viz_type, v) for v in viz_types_list]) +viz_types = OrderedDict([(v.viz_type, v) for v in viz_types_list + if v.viz_type not in config.get('VIZ_TYPE_BLACKLIST')])