-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
Use config[]
not config.get()
#8454
Merged
mistercrunch
merged 7 commits into
apache:master
from
preset-io:wbarrett/config-not-config-get
Oct 30, 2019
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
40bf18a
Typo fix in CONTRIBUTING.md
8a9cdba
Alter references to config.get('FOO') to use preferred config['FOO']
a4b91f0
Set missing configuration constants in superset/config.py
ff97e07
Merge branch 'master' into wbarrett/config-not-config-get
0b19330
Misc. CI fixes
ba0bee6
Merge branch 'wbarrett/config-not-config-get' of github.com:preset-io…
4a71552
Add type annotation for FEATURE_FLATGS
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,10 +35,14 @@ | |
from flask_appbuilder.security.manager import AUTH_DB | ||
|
||
from superset.stats_logger import DummyStatsLogger | ||
from superset.utils.log import DBEventLogger | ||
from superset.utils.logging_configurator import DefaultLoggingConfigurator | ||
|
||
# Realtime stats logger, a StatsD implementation exists | ||
STATS_LOGGER = DummyStatsLogger() | ||
EVENT_LOGGER = DBEventLogger() | ||
|
||
SUPERSET_LOG_VIEW = True | ||
|
||
BASE_DIR = os.path.abspath(os.path.dirname(__file__)) | ||
if "SUPERSET_HOME" in os.environ: | ||
|
@@ -109,6 +113,7 @@ def _try_json_readfile(filepath): | |
# def lookup_password(url): | ||
# return 'secret' | ||
# SQLALCHEMY_CUSTOM_PASSWORD_STORE = lookup_password | ||
SQLALCHEMY_CUSTOM_PASSWORD_STORE = None | ||
|
||
# The limit of queries fetched for query search | ||
QUERY_SEARCH_LIMIT = 1000 | ||
|
@@ -232,6 +237,9 @@ def _try_json_readfile(filepath): | |
"PRESTO_EXPAND_DATA": False, | ||
} | ||
|
||
# This is merely a default. | ||
FEATURE_FLAGS: Dict[str, bool] = {} | ||
|
||
# A function that receives a dict of all feature flags | ||
# (DEFAULT_FEATURE_FLAGS merged with FEATURE_FLAGS) | ||
# can alter it, and returns a similar dict. Note the dict of feature | ||
|
@@ -371,6 +379,7 @@ def _try_json_readfile(filepath): | |
# security_manager=None, | ||
# ): | ||
# pass | ||
QUERY_LOGGER = None | ||
|
||
# Set this API key to enable Mapbox visualizations | ||
MAPBOX_API_KEY = os.environ.get("MAPBOX_API_KEY", "") | ||
|
@@ -444,6 +453,7 @@ class CeleryConfig(object): | |
# override anything set within the app | ||
DEFAULT_HTTP_HEADERS: Dict[str, Any] = {} | ||
OVERRIDE_HTTP_HEADERS: Dict[str, Any] = {} | ||
HTTP_HEADERS: Dict[str, Any] = {} | ||
|
||
# The db id here results in selecting this one as a default in SQL Lab | ||
DEFAULT_DB_ID = None | ||
|
@@ -522,13 +532,18 @@ class CeleryConfig(object): | |
SMTP_MAIL_FROM = "[email protected]" | ||
|
||
if not CACHE_DEFAULT_TIMEOUT: | ||
CACHE_DEFAULT_TIMEOUT = CACHE_CONFIG.get("CACHE_DEFAULT_TIMEOUT") # type: ignore | ||
CACHE_DEFAULT_TIMEOUT = CACHE_CONFIG["CACHE_DEFAULT_TIMEOUT"] | ||
|
||
|
||
ENABLE_CHUNK_ENCODING = False | ||
|
||
# Whether to bump the logging level to ERROR on the flask_appbuilder package | ||
# Set to False if/when debugging FAB related issues like | ||
# permission management | ||
SILENCE_FAB = True | ||
|
||
FAB_ADD_SECURITY_VIEWS = True | ||
|
||
# The link to a page containing common errors and their resolutions | ||
# It will be appended at the bottom of sql_lab errors. | ||
TROUBLESHOOTING_LINK = "" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good example of why this change is good; no point in having secondary default values spread across the codebase, as these should only be defaulted in one place.