作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我知道priority_weight
可以设置为DAG
在 default_args
按照官方文档中的示例here .
我们也可以设置priority_weight
DAG
中的每个任务都不同。 ?
按照教程中的示例,这意味着 t1
将具有与 t2
不同的优先级.
最佳答案
Can we also set priority_weight that is different for each task in the DAG?
..we have the choice to explicitly pass a set of arguments to each task’s constructor (which would become redundant), or (better!) we can define a dictionary of default parameters that we can use when creating tasks..
priority_weight
中传递的
default_args
实际上是针对单个
task
s 而不是
DAG
本身。当然,查看代码很明显它是
parameter of BaseOperator
和
not DAG
SQLAlchemy
模型
task
的每个
DAG
分配相同的优先级并没有多大意义。官方文档中的上述示例似乎确实忽略了这个简单的推理(除非我遗漏了一些东西)。然而
docstring 似乎确实表明了这一点
:param priority_weight: priority weight of this task against other task.
This allows the executor to trigger higher priority tasks before
others when things get backed up.
priority_weight
分配给 DAG 中的所有任务毕竟不是不合理的,因为
priority_weight
不是在 DAG 级别强制执行,而是在 pool
级别
priority_weight
的单个值,该值高于第二个 dag 中的任务的值。 关于airflow - 我们可以在 Airflow 中为每个任务设置 priority_weight 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55145641/
我知道priority_weight可以设置为DAG在 default_args按照官方文档中的示例here . 我们也可以设置priority_weight DAG 中的每个任务都不同。 ? 按照教
我是一名优秀的程序员,十分优秀!