Skip to content

delete_dag in json_client, the end_point is wrong #14373

@huaerheima

Description

@huaerheima

Apache Airflow version: 1.10.12

the code of the function delete_dag in /airflow/api/client/json_client.py

def delete_dag(self, dag_id):
    endpoint = '/api/experimental/dags/{}/delete_dag'.format(dag_id)
    url = urljoin(self._api_base_url, endpoint)
    data = self._request(url, method='DELETE')
    return data['message']

the code of the function delete_dag in /airflow/www/api/experimental/endpoints.py

@csrf.exempt
@api_experimental.route('/dags/<string:dag_id>', methods=['DELETE'])
@requires_authentication
def delete_dag(dag_id):
    """
    Delete all DB records related to the specified Dag.
    """
    try:
        count = delete.delete_dag(dag_id)
    ...

I found the endpoint is diffent with the route of delete_dag, this should be a bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:bugThis is a clearly a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions