I am trying to customising my Apache Superset. I am not very familiar with Terminal.
On the documentation it is written: "To configure your application, you need to create a file (module) superset_config.py and make sure it is in your PYTHONPATH. Here are some of the parameters you can copy / paste in that configuration module:".
Let's say I want to decrease ROW_LIMIT to 5000, and my Superset is installed on an Anaconda Environment called "ExperimentSuperset". Can someone please explain to me what do I have to do to reach this results ?
Thanks a lot !
The pythonpath is mainly defined by:
(Also it can be enhanced using sys.path and pth file - which definesdirectories and itself needs to be in python).
To my experience, pythonpath variable is set by most superset applications and can be evaluated the simplest way by calling set
in console or echo $pythonpath
. You can also use python to print out the pythonpath from terminal: python -c "import sys; print('\n'.join(sys.path))"
.
Superset looks in the path for a file called superset_config.py
there. You can also directly point to the file even if it is not in the path when you set the environment variable SUPERSET_CONFIG_PATH=/your/path/to/superset_config.py
.
In the sources there's a file called config.py
that has all settings. All settings there will be overwritten with the settings loaded from superset_config.py
. So you just need to define the specifics of your superset application.
So your specific steps are:
superset_config.py
ROW_LIMIT = 5000
to fileSUPERSET_CONFIG_PATH
Superset will then use the config file and read your settings. Noite the config is a fully functional python file, so you can add methods etc. In the superset example there's a useful method pulling parameters in from environment variables. This is especially useful when using e.g. Docker.
At the end of config.py
you'll see that it tries to load superset_config.py
from SUPERSET_CONFIG_PATH
so all you need to do is:
export SUPERSET_CONFIG_PATH=/path/to/your/superset_config.py
Source: https://github.com/apache/superset/issues/2117#issuecomment-277666183
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With