2019-01-15 18:53:27 -05:00
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one
|
|
|
|
# or more contributor license agreements. See the NOTICE file
|
|
|
|
# distributed with this work for additional information
|
|
|
|
# regarding copyright ownership. The ASF licenses this file
|
|
|
|
# to you under the Apache License, Version 2.0 (the
|
|
|
|
# "License"); you may not use this file except in compliance
|
|
|
|
# with the License. You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing,
|
|
|
|
# software distributed under the License is distributed on an
|
|
|
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
# KIND, either express or implied. See the License for the
|
|
|
|
# specific language governing permissions and limitations
|
|
|
|
# under the License.
|
2020-04-04 16:23:18 -04:00
|
|
|
# type: ignore
|
2019-02-27 18:11:38 -05:00
|
|
|
from copy import copy
|
2019-10-18 17:44:27 -04:00
|
|
|
|
2020-04-04 16:23:18 -04:00
|
|
|
from superset.config import *
|
2020-04-07 16:00:42 -04:00
|
|
|
from tests.superset_test_custom_template_processors import CustomPrestoTemplateProcessor
|
2016-03-18 02:44:58 -04:00
|
|
|
|
2019-06-25 16:34:48 -04:00
|
|
|
AUTH_USER_REGISTRATION_ROLE = "alpha"
|
|
|
|
SQLALCHEMY_DATABASE_URI = "sqlite:///" + os.path.join(DATA_DIR, "unittests.db")
|
2016-03-18 02:44:58 -04:00
|
|
|
DEBUG = True
|
2016-11-10 02:08:22 -05:00
|
|
|
SUPERSET_WEBSERVER_PORT = 8081
|
2016-06-09 21:05:58 -04:00
|
|
|
|
|
|
|
# Allowing SQLALCHEMY_DATABASE_URI to be defined as an env var for
|
|
|
|
# continuous integration
|
2019-06-25 16:34:48 -04:00
|
|
|
if "SUPERSET__SQLALCHEMY_DATABASE_URI" in os.environ:
|
2019-10-18 17:44:27 -04:00
|
|
|
SQLALCHEMY_DATABASE_URI = os.environ["SUPERSET__SQLALCHEMY_DATABASE_URI"]
|
2016-08-30 00:55:31 -04:00
|
|
|
|
2020-04-28 17:28:09 -04:00
|
|
|
if "sqlite" in SQLALCHEMY_DATABASE_URI:
|
|
|
|
logger.warning(
|
|
|
|
"SQLite Database support for metadata databases will be \
|
|
|
|
removed in a future version of Superset."
|
|
|
|
)
|
|
|
|
|
2016-08-30 00:55:31 -04:00
|
|
|
SQL_MAX_ROW = 666
|
2020-03-03 12:52:20 -05:00
|
|
|
SQLLAB_CTAS_NO_LIMIT = True # SQL_MAX_ROW will not take affect for the CTA queries
|
2020-02-19 12:51:50 -05:00
|
|
|
FEATURE_FLAGS = {"foo": "bar", "KV_STORE": True, "SHARE_QUERIES_VIA_KV_STORE": True}
|
2019-06-25 16:34:48 -04:00
|
|
|
|
|
|
|
|
2019-02-27 18:11:38 -05:00
|
|
|
def GET_FEATURE_FLAGS_FUNC(ff):
|
|
|
|
ff_copy = copy(ff)
|
2019-06-25 16:34:48 -04:00
|
|
|
ff_copy["super"] = "set"
|
2019-02-27 18:11:38 -05:00
|
|
|
return ff_copy
|
|
|
|
|
2016-08-30 00:55:31 -04:00
|
|
|
|
|
|
|
TESTING = True
|
|
|
|
WTF_CSRF_ENABLED = False
|
|
|
|
PUBLIC_ROLE_LIKE_GAMMA = True
|
2019-06-25 16:34:48 -04:00
|
|
|
AUTH_ROLE_PUBLIC = "Public"
|
2017-01-24 21:11:51 -05:00
|
|
|
EMAIL_NOTIFICATIONS = False
|
2016-08-30 00:55:31 -04:00
|
|
|
|
2019-06-25 16:34:48 -04:00
|
|
|
CACHE_CONFIG = {"CACHE_TYPE": "simple"}
|
|
|
|
|
2017-02-08 14:52:58 -05:00
|
|
|
|
2016-08-30 00:55:31 -04:00
|
|
|
class CeleryConfig(object):
|
2020-04-14 16:38:09 -04:00
|
|
|
BROKER_URL = "redis://{}:{}".format(
|
|
|
|
os.environ.get("REDIS_HOST", "localhost"), os.environ.get("REDIS_PORT", "6379")
|
|
|
|
)
|
2019-06-25 16:34:48 -04:00
|
|
|
CELERY_IMPORTS = ("superset.sql_lab",)
|
|
|
|
CELERY_ANNOTATIONS = {"sql_lab.add": {"rate_limit": "10/s"}}
|
2016-08-30 00:55:31 -04:00
|
|
|
CONCURRENCY = 1
|
2017-11-10 20:52:34 -05:00
|
|
|
|
|
|
|
|
2016-08-30 00:55:31 -04:00
|
|
|
CELERY_CONFIG = CeleryConfig
|
2020-04-07 16:00:42 -04:00
|
|
|
|
|
|
|
CUSTOM_TEMPLATE_PROCESSORS = {
|
|
|
|
CustomPrestoTemplateProcessor.engine: CustomPrestoTemplateProcessor
|
|
|
|
}
|