【发布时间】:2018-03-14 01:29:45
【问题描述】:
我一直试图在 bash 脚本中将变量的内容发送到 Xcom。但是,我失败了。
test_bash = """
export test_val='123'
{{ ti.xcom_push(key='1',value=test_val) }}
echo $test_val
"""
bash_tash = BashOperator(
task_id='test',
bash_command=test_bash,
retries=3,
dag=dag)
在上面的代码中。当我试图拉它。我无法向 Xcom 发送任何内容。我试过用单引号发送文本,效果很好。
有没有办法将变量从 bash 脚本发送到 xcom?
【问题讨论】:
标签: bash airflow templating