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 2021/09/18 15:52:12 UTC

[GitHub] [airflow] utkarshgupta137 edited a comment on issue #13559: Nested templated variables do not always render

utkarshgupta137 edited a comment on issue #13559:
URL: https://github.com/apache/airflow/issues/13559#issuecomment-922331197


   I was having a similar problem: I wanted to pass a templated argument to a function, but it kept getting passed as raw template instead of rendered one.
   
   The solution is to call the macro inside a pythonoperator & pass the data using xcoms.
   
   ```
   def get_date(**kwargs):
       # {{ dag_run.conf.get("date", "{{ ds_no_dash }}") }} doesn't work
   
       ds = kwargs["ds_no_dash"]
       date = kwargs["dag_run"].conf.get("date", ds)
       kwargs["ti"].xcom_push("date", base_data)
   ```


-- 
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