编辑 2018 年 8 月 27 日 - Airflow 1.10 现已在 PyPI 上发布!
https://pypi.org/project/apache-airflow/1.10.0/ https://pypi.org/project/apache-airflow/1.10.0/
如何彻底删除DAG
我们现在在 Airflow ≥ 1.10 中拥有此功能!
The PR #2199 https://github.com/apache/incubator-airflow/pull/2199 (Jira: 气流-1002 https://issues.apache.org/jira/browse/AIRFLOW-1002)将 DAG 删除添加到 Airflow 现已合并,允许从所有相关表中完全删除 DAG 条目。
核心删除_达格(...) https://github.com/apache/incubator-airflow/blob/7488f2938da4e08645060531aa363204db7f50a5/airflow/api/common/experimental/delete_dag.py#L28-L55代码现在是实验性 API 的一部分,并且有可用的入口点通过 CLI https://github.com/apache/incubator-airflow/blob/9dba430b683361fc0ed7f50de6daa03c971a476b/airflow/bin/cli.py#L214-L232并且通过 REST API https://github.com/apache/incubator-airflow/blob/7488f2938da4e08645060531aa363204db7f50a5/airflow/www/api/experimental/endpoints.py#L89-L103.
CLI:
airflow delete_dag my_dag_id
REST API(本地运行网络服务器):
curl -X "DELETE" http://127.0.0.1:8080/api/experimental/dags/my_dag_id
有关 REST API 的警告:确保您的 Airflow 集群使用身份验证 https://airflow.apache.org/api.html#authentication在生产中。
安装/升级到 Airflow 1.10(当前)
要升级,请运行:
export SLUGIFY_USES_TEXT_UNIDECODE=yes
or:
export AIRFLOW_GPL_UNIDECODE=yes
Then:
pip install -U apache-airflow
记得检查一下更新.md https://github.com/apache/incubator-airflow/blob/master/UPDATING.md首先了解完整的详细信息!