GitHub user dosubot[bot] added a comment to the discussion: Define constant 
variable

<!-- Greeting -->
@Cristian-wp ¡Hola! Soy Dosu, un bot que puede ayudarte a resolver problemas, 
responder preguntas y convertirte en un colaborador. Estoy aquí para ayudarte 
mientras esperas a un mantenedor humano.

<!-- Answer -->
You can define and manage global variables or constants in Apache Superset's 
configuration by using the `superset_config.py` file. This file allows you to 
override any configuration settings defined in the main `superset/config.py` 
file. At the end of the `superset/config.py` file, there is a line `from 
superset_config import *`, which imports all settings from 
`superset_config.py`, allowing you to define global variables or constants 
there.

For example, you can define a global variable in `superset_config.py` like this:

```python
# superset_config.py

COST = 4.75
IVA = 0.20
```

These variables can then be accessed throughout the Superset application 
<sup>[[1]](https://github.com/apache/superset/blob/master/superset/config.py)</sup>.
 However, note that directly referencing these variables in SQL queries might 
not be straightforward, and you may need to explore using Jinja templating or 
other methods to incorporate them into your queries.


<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*

---
<sup>Help Dosu learn! Give it feedback: [Great 
Response](https://app.dosu.dev/response-feedback/4d2ee05f-ec21-4a31-a0f2-e18a67fc1932?feedback_type=great_response)
 | [Irrelevant 
Answer](https://app.dosu.dev/response-feedback/4d2ee05f-ec21-4a31-a0f2-e18a67fc1932?feedback_type=irrelevant_answer)
 | [Incorrect 
Sources](https://app.dosu.dev/response-feedback/4d2ee05f-ec21-4a31-a0f2-e18a67fc1932?feedback_type=incorrect_sources)
 | [Too 
Verbose](https://app.dosu.dev/response-feedback/4d2ee05f-ec21-4a31-a0f2-e18a67fc1932?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/4d2ee05f-ec21-4a31-a0f2-e18a67fc1932?feedback_type=hallucination)
 | [Bug 
Report](https://app.dosu.dev/response-feedback/4d2ee05f-ec21-4a31-a0f2-e18a67fc1932?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/4d2ee05f-ec21-4a31-a0f2-e18a67fc1932?feedback_type=other)</sup>


GitHub link: 
https://github.com/apache/superset/discussions/32899#discussioncomment-12654332

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to