[
https://issues.apache.org/jira/browse/AIRFLOW-5644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17362779#comment-17362779
]
ASF GitHub Bot commented on AIRFLOW-5644:
-----------------------------------------
mathee06 commented on pull request #6317:
URL: https://github.com/apache/airflow/pull/6317#issuecomment-859556243
Hi @BasPH,
I realize this is an old thread now, but we just migrated to Airflow 2.0.0.
Similar to @Sharadh, **is there a way to dynamically pass a dag_run_obj or
conf object to the new DAG that was triggered?**
There does not seem to be a way to do this with the removal of the
python_callable function.
Is "downstream_payload" below a unique variable that passes the current
DAG's dag_run object to the new triggered DAG?
> ```python
> conf={"downstream_payload": "{{ dag_run.conf['downstream_payload'] }}"}
> ```
Here is my Current Code (w/ some explanation on the flow and approach):
#Poll S3 folder for new received files
fileSensor_tsk = S3KeySensor()
#Use chooseDAGBasedOnInput function to create dag_run object (previously
python_callable was used directly in TriggerDagRunOperator to create the
dag_run object for the new triggered DAG)
#dag_run object will pass received file name details to new DAG for
reference in order to complete its own work
chooseDAGTrigger_tsk = BranchPythonOperator(
task_id='chooseDAGTrigger_tsk',
python_callable=chooseDAGBasedOnInput,
provide_context=True
)
triggerNewDAG_tsk = TriggerDagRunOperator(
task_id='triggerNewDAG_tsk',
trigger_dag_id='1000_NEW_LOAD'
)
triggerNewDAG2_tsk = TriggerDagRunOperator(
task_id='triggerNew2DAG_tsk',
trigger_dag_id='1000_NEW2_LOAD'
) ...
Any help or advise would be appreciated!
Thank you.
--
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:
[email protected]
> Simplify TriggerDagRunOperator usage
> ------------------------------------
>
> Key: AIRFLOW-5644
> URL: https://issues.apache.org/jira/browse/AIRFLOW-5644
> Project: Apache Airflow
> Issue Type: Improvement
> Components: operators
> Affects Versions: 2.0.0
> Reporter: Bas Harenslak
> Priority: Major
> Fix For: 2.0.0
>
>
> The TriggerDagRunOperator usage is rather odd at the moment, especially the
> way to pass a conf.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)