matthewblock opened a new issue, #44819:
URL: https://github.com/apache/airflow/issues/44819

   ### Description
   
   PR #37028 in Airflow 2.10.0 introduced the ability to pass a Python callable 
to templateable fields, instead of a Jinja templated string:
   
   
https://www.astronomer.io/docs/learn/templating/#use-a-python-callable-for-template-fields
   > In Airflow 2.10+ it is possible to pass a Python callable to templateable 
fields. This is especially useful when the parameter value is created using 
complex operations that might not be possible or are hard to read in Jinja.
   
   However, this feature doesn't seem to work for `@task.*` decorated tasks.
   
   IMO it doesn't make sense to introduce a new feature that only works with 
the old style of tasks.
   
   This feature is to make the new Python callable templating work for `@task` 
decorated TaskFlow API tasks.
   
   ### Use case/motivation
   
   I want to specify a Python function for a templated field, instead of a 
Jinja templated string, for the reasons mentioned in the linked PR. For complex 
logic, it's much easier to implement and read Jinja rendering functions than a 
Jinja templated string.
   
   ### Related issues
   
   https://github.com/apache/airflow/pull/35844
   https://github.com/apache/airflow/pull/37028
   
   ### Are you willing to submit a PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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.apache.org

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

Reply via email to