You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@airflow.apache.org by manish ranjan <cs...@gmail.com> on 2017/07/12 21:23:13 UTC

Trying to get rid of a DAG from UI after running it for a while

Hi All,

I have had a DAG, which I needed to clean up from UI (airflow version
v1.7.1.3)

Following this Jira <https://issues.apache.org/jira/browse/AIRFLOW-1002> I
deleted manually from all the tables
queries = {'delete from *xcom* where dag_id = "' + dag_input + '"',
        'delete from *task_instance* where dag_id = "' + dag_input + '"',
        'delete from *sla_miss* where dag_id = "' + dag_input + '"',
        'delete from *log* where dag_id = "' + dag_input + '"',
        'delete from *job* where dag_id = "' + dag_input + '"',
        'delete from *dag_run* where dag_id = "' + dag_input + '"',
        'delete from *dag* where dag_id = "' + dag_input + '"' }

But the dag from airflow UI just won't go away :( Is there something basic
I am missing?

PS: I also saw that you guys have merged this PR
<https://github.com/apache/incubator-airflow/pull/2199> just a few days
back so we will be able to do this from CLI. Thanks for that. But how can I
do this today?

~Manish

Re: Trying to get rid of a DAG from UI after running it for a while

Posted by manish ranjan <cs...@gmail.com>.
Thanks, Andrew. I have configured my airflow to work with an RDS database.
I did delete the entries, and the task is still appearing on UI. So was
wondering if I am missing something. Do I have to remove it from airflow's
local DB also?

~Manish



On Thu, Jul 13, 2017 at 6:26 AM, Andrew Maguire <an...@gmail.com>
wrote:

>
>
> On Thu, Jul 13, 2017 at 2:25 PM Andrew Maguire <an...@gmail.com>
> wrote:
>
>> It could be that you need to remove it from the database aswell - think i
>> recall reading that somewhere.
>>
>> Here is a script that takes in a dag name and deletes it from the
>> database - has been working for me. But not sure if this a recommended
>> practice or anything.
>>
>> https://github.com/andrewm4894/airflow-examples/blob/master/delete_dag.py
>>
>>
>> On Wed, Jul 12, 2017 at 10:33 PM manish ranjan <cs...@gmail.com>
>> wrote:
>>
>>> Hi All,
>>>
>>> I have had a DAG, which I needed to clean up from UI (airflow version
>>> v1.7.1.3)
>>>
>>> Following this Jira <https://issues.apache.org/jira/browse/AIRFLOW-1002>
>>> I
>>> deleted manually from all the tables
>>> queries = {'delete from *xcom* where dag_id = "' + dag_input + '"',
>>>         'delete from *task_instance* where dag_id = "' + dag_input + '"',
>>>         'delete from *sla_miss* where dag_id = "' + dag_input + '"',
>>>         'delete from *log* where dag_id = "' + dag_input + '"',
>>>         'delete from *job* where dag_id = "' + dag_input + '"',
>>>         'delete from *dag_run* where dag_id = "' + dag_input + '"',
>>>         'delete from *dag* where dag_id = "' + dag_input + '"' }
>>>
>>> But the dag from airflow UI just won't go away :( Is there something
>>> basic
>>> I am missing?
>>>
>>> PS: I also saw that you guys have merged this PR
>>> <https://github.com/apache/incubator-airflow/pull/2199> just a few days
>>> back so we will be able to do this from CLI. Thanks for that. But how
>>> can I
>>> do this today?
>>>
>>> ~Manish
>>>
>>

Re: Trying to get rid of a DAG from UI after running it for a while

Posted by Andrew Maguire <an...@gmail.com>.
On Thu, Jul 13, 2017 at 2:25 PM Andrew Maguire <an...@gmail.com>
wrote:

> It could be that you need to remove it from the database aswell - think i
> recall reading that somewhere.
>
> Here is a script that takes in a dag name and deletes it from the database
> - has been working for me. But not sure if this a recommended practice or
> anything.
>
> https://github.com/andrewm4894/airflow-examples/blob/master/delete_dag.py
>
>
> On Wed, Jul 12, 2017 at 10:33 PM manish ranjan <cs...@gmail.com>
> wrote:
>
>> Hi All,
>>
>> I have had a DAG, which I needed to clean up from UI (airflow version
>> v1.7.1.3)
>>
>> Following this Jira <https://issues.apache.org/jira/browse/AIRFLOW-1002>
>> I
>> deleted manually from all the tables
>> queries = {'delete from *xcom* where dag_id = "' + dag_input + '"',
>>         'delete from *task_instance* where dag_id = "' + dag_input + '"',
>>         'delete from *sla_miss* where dag_id = "' + dag_input + '"',
>>         'delete from *log* where dag_id = "' + dag_input + '"',
>>         'delete from *job* where dag_id = "' + dag_input + '"',
>>         'delete from *dag_run* where dag_id = "' + dag_input + '"',
>>         'delete from *dag* where dag_id = "' + dag_input + '"' }
>>
>> But the dag from airflow UI just won't go away :( Is there something basic
>> I am missing?
>>
>> PS: I also saw that you guys have merged this PR
>> <https://github.com/apache/incubator-airflow/pull/2199> just a few days
>> back so we will be able to do this from CLI. Thanks for that. But how can
>> I
>> do this today?
>>
>> ~Manish
>>
>

Re: Trying to get rid of a DAG from UI after running it for a while

Posted by Andrew Maguire <an...@gmail.com>.
It could be that you need to remove it from the database aswell - think i
recall reading that somewhere.

Here is a script that takes in a dag name and deletes it from the database
- has been working for me. But not sure if this a recommended practice or
anything.

https://github.com/andrewm4894/airflow-examples/blob/master/delete_dag.py


On Wed, Jul 12, 2017 at 10:33 PM manish ranjan <cs...@gmail.com>
wrote:

> Hi All,
>
> I have had a DAG, which I needed to clean up from UI (airflow version
> v1.7.1.3)
>
> Following this Jira <https://issues.apache.org/jira/browse/AIRFLOW-1002> I
> deleted manually from all the tables
> queries = {'delete from *xcom* where dag_id = "' + dag_input + '"',
>         'delete from *task_instance* where dag_id = "' + dag_input + '"',
>         'delete from *sla_miss* where dag_id = "' + dag_input + '"',
>         'delete from *log* where dag_id = "' + dag_input + '"',
>         'delete from *job* where dag_id = "' + dag_input + '"',
>         'delete from *dag_run* where dag_id = "' + dag_input + '"',
>         'delete from *dag* where dag_id = "' + dag_input + '"' }
>
> But the dag from airflow UI just won't go away :( Is there something basic
> I am missing?
>
> PS: I also saw that you guys have merged this PR
> <https://github.com/apache/incubator-airflow/pull/2199> just a few days
> back so we will be able to do this from CLI. Thanks for that. But how can I
> do this today?
>
> ~Manish
>