You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "gdavoian (via GitHub)" <gi...@apache.org> on 2023/11/06 15:05:02 UTC

Re: [PR] Add a check for not templateable fields [airflow]

gdavoian commented on PR #29821:
URL: https://github.com/apache/airflow/pull/29821#issuecomment-1795037963

   @hussein-awala Unfortunately, this change is going to break our Airflow environment. 
   
   Is there any reason why `BaseOperator.email` can't be templated? E.g., we store different email lists as Airflow variables, and we don't want to use `Variable.get(...)` on the module-level of our scripts because it's actually an anti-pattern (opening a DB connection, making a request, etc.). So that's why we had to implement a function for adding `email` to `template_fields` for all subclasses of `BaseOperator` dynamically at run-time, which allowed us to use Jinja templates in `default_args["email"]` of our DAGs.
   
   Actually, it's working just fine! But you're going to prohibit that in future versions, and I'd like to know the rationale behind that decision.


-- 
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-unsubscribe@airflow.apache.org

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