luoyuliuyin opened a new issue #20458:
URL: https://github.com/apache/airflow/issues/20458


   ### Apache Airflow version
   
   2.2.3 (latest released)
   
   ### What happened
   
   **the API of delete_dag does not delete the record in dag_code.**
   
   
![image](https://user-images.githubusercontent.com/28948186/147068771-0560119d-8d3d-4472-be09-a72f61dfb77f.png)
   
   This function will delete all the records containing the dag_id field, and 
will delete the related records of TaskFail, TaskInstance, ImportError. But the 
dag_code table does not have a dag_id field, the records in it will not be 
deleted.
   `function location: 
airflow.api_connexion.endpoints.dag_endpoint.delete_dag()`
   
![image](https://user-images.githubusercontent.com/28948186/147068839-850e7442-f565-4ba2-bc55-223686388504.png)
   
   show create table of dag_code
   
![image](https://user-images.githubusercontent.com/28948186/147068905-0f257348-a56d-4440-9435-6ace5d980865.png)
   
   
   ### What you expected to happen
   
   All related records in the database are deleted, including the dag_code 
table.
   
   ### How to reproduce
   
   _No response_
   
   ### Operating System
   
   MacOS 12.1
   
   ### Versions of Apache Airflow Providers
   
   2.2.2
   
   ### Deployment
   
   Virtualenv installation
   
   ### Deployment details
   
   _No response_
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to