Python 使用CLI run命令在Airflow中触发任务

Python 使用CLI run命令在Airflow中触发任务,python,airflow,Python,Airflow,如何使用CLI中的run命令触发气流(v1.8.1)DAG中的特定任务 达格 命令 airflow run -i -I -f test_run two 2018-08-21T18:59:51 我尝试了-I、-I和-f命令,没有任何运气和错误。我还尝试了忽略所有依赖项的-A,但没有告诉我命令中没有执行日期 如果我运行相同的命令,但指定了taskone,我可以看到它成功地显示在任务实例列表中,但我似乎无法在完全忽略taskone的情况下运行tasktwo 尝试运行two时的实际输出 datause

如何使用CLI中的
run
命令触发气流(v1.8.1)DAG中的特定任务

达格

命令

airflow run -i -I -f test_run two 2018-08-21T18:59:51
我尝试了
-I
-I
-f
命令,没有任何运气和错误。我还尝试了忽略所有依赖项的
-A
,但没有告诉我命令中没有执行日期

如果我运行相同的命令,但指定了task
one
,我可以看到它成功地显示在任务实例列表中,但我似乎无法在完全忽略task
one
的情况下运行task
two

尝试运行
two
时的实际输出

datauser@ubuntu-xenial:/home/vagrant$ AIRFLOW_HOME=~/code/dataprocessing/ /virtualenvs/dataprocessing/bin/airflow run -i -I -f test_run two 2018-08-21T18:59:51
/virtualenvs/dataprocessing/lib/python3.5/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
  """)
[2018-08-21 19:11:51,538] {__init__.py:57} INFO - Using executor CeleryExecutor
[2018-08-21 19:11:51,624] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python3.5/lib2to3/Grammar.txt
[2018-08-21 19:11:51,650] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
Sending to executor.
INFO:root:The key logs/test_run/two/2018-08-21T18:59:51 now contains 101162 bytes

这是Airflow version=1.9中的一个错误。

我认为语法正确。您能否发布在第二个任务上运行
$airflow run…
命令时获得的输出?谢谢您的评论。我又添加了一些输出。你能试着删除
-I
依赖于过去的
的标志吗?如果有任何不同,请发布该标志的输出?我在没有
-I
的情况下运行了它并发布了输出。是一样的。嗯,我不确定。乍一看,我的印象是这个问题是由现有的文档回答的,但仔细看,我认为您可能发现了一个bug,因为您的命令的语法对我来说是正确的。也许其他人也有同样的第一印象——我只是投了赞成票来平衡它。
datauser@ubuntu-xenial:/home/vagrant$ AIRFLOW_HOME=~/code/dataprocessing/ /virtualenvs/dataprocessing/bin/airflow run -i -I -f test_run two 2018-08-21T18:59:51
/virtualenvs/dataprocessing/lib/python3.5/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
  """)
[2018-08-21 19:11:51,538] {__init__.py:57} INFO - Using executor CeleryExecutor
[2018-08-21 19:11:51,624] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python3.5/lib2to3/Grammar.txt
[2018-08-21 19:11:51,650] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
Sending to executor.
INFO:root:The key logs/test_run/two/2018-08-21T18:59:51 now contains 101162 bytes
[2018-08-21 19:13:49,796] {base_task_runner.py:95} INFO - Subtask: [2018-08-21 19:13:49,795] {models.py:1122} INFO - Dependencies not met for <TaskInstance: test_run.two 2018-08-21 18:59:51 [None]>, dependency 'Trigger Rule' FAILED: Task's trigger rule 'all_success' requires all upstream tasks to have succeeded, but found 1 non-success(es). upstream_tasks_state={'successes': 0, 'upstream_failed': 0, 'done': 0, 'skipped': 0, 'failed': 0}, upstream_task_ids=['one']
[2018-08-22 16:47:19,582] {base_task_runner.py:95} INFO - Subtask: [2018-08-22 16:47:19,581] {models.py:1122} INFO - Dependencies not met for <TaskInstance: test_run.two 2018-08-22 00:59:51 [None]>, dependency 'Trigger Rule' FAILED: Task's trigger rule 'all_success' requires all upstream tasks to have succeeded, but found 1 non-success(es). upstream_tasks_state={'upstream_failed': 0, 'successes': 0, 'done': 0, 'skipped': 0, 'failed': 0}, upstream_task_ids=['one']