From 9f9541294c79ea154dc6fb3bc334ac6790f04c3f Mon Sep 17 00:00:00 2001 From: Madison Swain-Bowden Date: Mon, 14 Feb 2022 14:45:11 -0800 Subject: [PATCH] Add note about Variable precedence with env vars This PR updates some documentation regarding setting Airflow Variables using environment variables. Environment variables take precedence over variables defined in the UI/metastore based on this default search path list: https://github.dev/apache/airflow/blob/7864693e43c40fd8f0914c05f7e196a007d16d50/airflow/secrets/__init__.py#L29-L30 --- docs/apache-airflow/howto/variable.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/apache-airflow/howto/variable.rst b/docs/apache-airflow/howto/variable.rst index 7cb9377bdcf15..401dcb146b4aa 100644 --- a/docs/apache-airflow/howto/variable.rst +++ b/docs/apache-airflow/howto/variable.rst @@ -62,7 +62,8 @@ You can use them in your DAGs as: Single underscores surround ``VAR``. This is in contrast with the way ``airflow.cfg`` parameters are stored, where double underscores surround the config section name. Variables set using Environment Variables would not appear in the Airflow UI but you will - be able to use them in your DAG file. + be able to use them in your DAG file. Variables set using Environment Variables will also + take precedence over variables defined in the Airflow UI. Securing Variables ------------------