-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
how to use variables ? #12
Comments
I need to add an entry in the documentation to explain this, but variables are general purpose and used to control or alter the behavior of specific pipelines that define logic based on the content of variables. For instance there could be a convention that an "aggregation framework" would look for variables starting with the prefix So it's just a place to store metadata that pipelines can read from. Arguably most of this metadata should be code and live in source control, but sometimes we need some settings to be more reactive and that's when we use variables. Our only internal use case now is a backfilling framework that allows us to run huge backfills efficiently. Another thought is Airflow doesn't expose a way to communicate across tasks, or even for an upstream task influence the behavior of a downstream tasks. Maybe variables could be used for that purpose, but that's somewhat messy. |
How can variables be accessed? We want to use variables for providing development and production flags within the creation of the DAG or within the task template. |
Variable is a sqlalchemy model and is located at I just added a simple utility classmethod to easily This makes it a very concise call to get a variable.
Though this is not in the current pypi release, it will make it to 1.1.0 . In the meantime you can look at the method for the more verbose way to get the variable. |
Thank's a lot! That was, what I was looking for. |
Just asking if it is possible to set Variables in code(like in some hook class). Cause I want to save the http connection cookies as variables. |
Never mind, I found my answer here: #220 |
using zomato fork of airflow-prometheus-exporter
webserver presents a possibility to define variables but there is no documentation on how to use those variables (and I don't see any usage in code).
Is it a way to defined "constants" to use in templates/arguments? How can we use them?
The text was updated successfully, but these errors were encountered: