From c03b086e488229857d6ca49a715f3120112ed3c8 Mon Sep 17 00:00:00 2001 From: Madison Swain-Bowden Date: Tue, 15 Feb 2022 13:56:00 -0800 Subject: [PATCH] Add note about Variable precedence with env vars (#21568) 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 (cherry picked from commit 7a268cb3c9fc6bc03f2400c6632ff8dccf4e451e) --- 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 ------------------