superset_test_config_sqllab_backend_persist.py 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # Licensed to the Apache Software Foundation (ASF) under one
  2. # or more contributor license agreements. See the NOTICE file
  3. # distributed with this work for additional information
  4. # regarding copyright ownership. The ASF licenses this file
  5. # to you under the Apache License, Version 2.0 (the
  6. # "License"); you may not use this file except in compliance
  7. # with the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing,
  12. # software distributed under the License is distributed on an
  13. # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. # KIND, either express or implied. See the License for the
  15. # specific language governing permissions and limitations
  16. # under the License.
  17. # flake8: noqa
  18. import os
  19. from copy import copy
  20. from superset.config import * # type: ignore
  21. AUTH_USER_REGISTRATION_ROLE = "alpha"
  22. SQLALCHEMY_DATABASE_URI = "sqlite:///" + os.path.join(DATA_DIR, "unittests.db")
  23. DEBUG = True
  24. SUPERSET_WEBSERVER_PORT = 8081
  25. # Allowing SQLALCHEMY_DATABASE_URI to be defined as an env var for
  26. # continuous integration
  27. if "SUPERSET__SQLALCHEMY_DATABASE_URI" in os.environ:
  28. SQLALCHEMY_DATABASE_URI = os.environ["SUPERSET__SQLALCHEMY_DATABASE_URI"]
  29. SQL_SELECT_AS_CTA = True
  30. SQL_MAX_ROW = 666
  31. FEATURE_FLAGS = {"foo": "bar"}
  32. def GET_FEATURE_FLAGS_FUNC(ff):
  33. ff_copy = copy(ff)
  34. ff_copy["super"] = "set"
  35. return ff_copy
  36. TESTING = True
  37. SECRET_KEY = "thisismyscretkey"
  38. WTF_CSRF_ENABLED = False
  39. PUBLIC_ROLE_LIKE_GAMMA = True
  40. AUTH_ROLE_PUBLIC = "Public"
  41. EMAIL_NOTIFICATIONS = False
  42. CACHE_CONFIG = {"CACHE_TYPE": "simple"}
  43. class CeleryConfig(object):
  44. BROKER_URL = "redis://localhost"
  45. CELERY_IMPORTS = ("superset.sql_lab",)
  46. CELERY_ANNOTATIONS = {"sql_lab.add": {"rate_limit": "10/s"}}
  47. CONCURRENCY = 1
  48. CELERY_CONFIG = CeleryConfig
  49. DEFAULT_FEATURE_FLAGS = {"SQLLAB_BACKEND_PERSISTENCE": True}