我找不到任何关于如何使用通过“-c”传递的JSON变量的工作文档,例如回填作业。在
我一直在打印我的python任务**kwargs以找出答案,但我仍然无法确定它。提供_context=True
谁能给我指出正确的方向吗?在
所以,我想做的是:airflow backfill mydag -c '{"override":"yes"}' -s 2018-12-01 -e 2018-12-12
我有一只Python:
^{pr2}$
在run_task中,我想访问override变量:def run_task(*args, **kwargs):
dag_run = kwargs.get('dag_run')
logging.info(kwargs['dag_run'].conf.get('override'))
但是我找不到访问这个覆盖变量的方法[2018-12-17 10:07:24,649] {models.py:1760} ERROR - 'NoneType' object has no attribute 'get'
Traceback (most recent call last):
File "/home/daimonie/.local/lib/python3.6/site-packages/airflow/models.py", line 1659, in _run_raw_task
result = task_copy.execute(context=context)
File "/home/daimonie/.local/lib/python3.6/site-pa