utkarsharma2 commented on PR #35546:
URL: https://github.com/apache/airflow/pull/35546#issuecomment-1803505297

   > For example, our team heavily relies on templating this field (e.g., "{{ 
var.value.some_email_list }}") as the default_args["email"] for each and every 
DAG we have, and we don't want to use Variable.get("some_email_list") on the 
module level of our scripts instead because it's actually an anti-pattern 
(opening a DB connection and making a SQL query under the hood at parsing time 
and not at execution time).
   
   @gdavoian No strong objections here, but I'm a little concerned that if it 
is a specific case of your team then the downside of this is we add an overhead 
of rendering this field for all operators in airflow for everyone who uses it. 
   
   Also, I checked the 
[code](https://github.com/apache/airflow/blob/main/airflow/models/variable.py#L271),
 and `Variable.get()` is using a cache so it might not be a bad idea to use it, 
considering the downside. WDYT?


-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to