jedcunningham commented on code in PR #30259:
URL: https://github.com/apache/airflow/pull/30259#discussion_r1270064267


##########
docs/apache-airflow/best-practices.rst:
##########
@@ -200,10 +200,12 @@ Some cases of dynamic DAG generation are described in the 
:doc:`howto/dynamic-da
 Airflow Variables
 -----------------
 
-As mentioned in the previous chapter, :ref:`best_practices/top_level_code`. 
you should avoid
-using Airflow Variables at top level Python code of DAGs. You can use the 
Airflow Variables freely inside the
-``execute()`` methods of the operators, but you can also pass the Airflow 
Variables to the existing operators
-via Jinja template, which will delay reading the value until the task 
execution.
+Using Airflow Variables yields network calls and database access, so their 
usage in top-level Python code for DAGs
+should be avoided, as mentioned in the previous chapter, 
:ref:`best_practices/top_level_code`.
+Their impact on DAG parsing can be mitigated though, by :ref:`enabling 
caching<config:secrets__use_cache>`
+with a sensible :ref:`ttl<config:secrets__cache_ttl_seconds>`.

Review Comment:
   In the docs we at least need to mention this is experimental. I also don't 
think we should present it as "safe", which is how I read the changes in this 
doc.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to