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/03/05 14:02:20 UTC

[GitHub] [airflow] ppierrep commented on issue #14623: Passing a jinja template in TriggerDagRunOperator conf raises json.decoder.JSONDecodeError

ppierrep commented on issue #14623:
URL: https://github.com/apache/airflow/issues/14623#issuecomment-791437986


   I managed to avoid the problem by unwraping the xcom like so:
   ```
   trigger_another_dag = TriggerDagRunOperator(
       task_id='trigger_another_dag',
       trigger_dag_id='another_dag',
       dag=dag,
       conf={
             'foo': "{{ ti.xcom_pull(task_ids='task1', key='return_value')['foo'] }}", 
             'bar': "{{ ti.xcom_pull(task_ids='task1', key='return_value')['bar'] }}", 
       }
   )
   ```
   As an alternative it works fine. Another solution would be to return multiple elements from the `PythonOperator`. IMO individually fetching them in `conf` is still inconvenient. 
   Please feel free to indicate what i do wrong in this in this configuration.


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

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