You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/08/29 14:22:45 UTC
[GitHub] [airflow] uranusjr commented on issue #26016: Allow template resolution of a upstream string passed via XComArg
uranusjr commented on issue #26016:
URL: https://github.com/apache/airflow/issues/26016#issuecomment-1230382822
In 2.4.0 we’ll roll out some helper methods to transform XCom values, specifically there’s `map()` that can be used to iterate through the list of values. So if we provide a helper function to render a template file, you could write something like
```python
# Illustrative only, actual module and function to be implemented.
from airflow.utils.templates import render_as_template
@task
def return_templates():
return [
'This is a template {{ ds }}',
'this_is_a_template.sql'
]
SnowflakeOperator.partial(task_id='run_sql_files').expand(
return_templates().map(render_as_template)
)
```
Would this make sense?
--
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