potiuk commented on a change in pull request #6601: [AIRFLOW-6010] Remove 
cyclic imports and pylint disables
URL: https://github.com/apache/airflow/pull/6601#discussion_r349806750
 
 

 ##########
 File path: airflow/utils/db.py
 ##########
 @@ -336,6 +336,8 @@ def resetdb():
     Clear out the database
     """
     from airflow import models
+    # noinspection PyUnresolvedReferences
+    from airflow.models.serialized_dag import SerializedDagModel  # noqa: F401 
isort # isort:skip
 
 Review comment:
   Not really. Try it yourself :). If you remove the import here and run 'db 
init' -> 'db reset' sequence you will get an error that the table already 
exists. Resetdb drops all the tables for which model is registered. Since we 
removed SerializedDagModel from `models.__init__.py` (we had to because it 
caused cyclic imports) we had to add it manually heere so that db reset deletes 
the table.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to