-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
chore: use os.getenv to simplify superset_config.py #25016
chore: use os.getenv to simplify superset_config.py #25016
Conversation
mypy.....................................................................Failed
- hook id: mypy
- exit code: 1
docker/pythonpath_dev/superset_config.py:38: error: Name "get_env_variable" is not defined [name-defined]
docker/pythonpath_dev/superset_config.py:39: error: Name "get_env_variable" is not defined [name-defined]
docker/pythonpath_dev/superset_config.py:40: error: Name "get_env_variable" is not defined [name-defined]
docker/pythonpath_dev/superset_config.py:41: error: Name "get_env_variable" is not defined [name-defined]
docker/pythonpath_dev/superset_config.py:42: error: Name "get_env_variable" is not defined [name-defined] This is the function I removed with this PR. Locally, all pre-commit checks run successfully. |
Ah, OK. There are new variables from a new commit in master. |
@sebastianliebscher would you mind describing where the defaults are coming from via either updating your PR description or adding inline review comments? |
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.
LGTM
@sebastianliebscher I'm a tad confused. You linked to the .env-non-dev file which would indicate that now we have two places (as opposed to one) where the same defaults are defined and thus this doesn't seem to adhere to the DRY principle. |
(cherry picked from commit 969cd66)
Since I have only now come to it: For completeness @john-bodley's concerns were resolved in #25055. |
SUMMARY
This PR removes a function in
superset_config.py
and replaces it by built-inos.getenv()
. Instead of raising an exception when the env variable is missing, they now have a default value. Their default values are the same as in.env
file (same values as in .env-non-dev)TESTING INSTRUCTIONS
Changes in
superset_config.py
only affect docker deployments, so in order to test this PR rundocker-compose up
and check variables values.ADDITIONAL INFORMATION