I have started the Airflow webserver and scheduled some dags. I can see the dags on web GUI.
How can I delete a particular DAG from being run and shown in web GUI? I
This is my adapted code using PostgresHook with the default connection_id.
import sys
from airflow.hooks.postgres_hook import PostgresHook
dag_input = sys.argv[1]
hook=PostgresHook( postgres_conn_id= "airflow_db")
for t in ["xcom", "task_instance", "sla_miss", "log", "job", "dag_run", "dag" ]:
sql="delete from {} where dag_id='{}'".format(t, dag_input)
hook.run(sql, True)