uranusjr commented on code in PR #23317:
URL: https://github.com/apache/airflow/pull/23317#discussion_r894312527


##########
airflow/dag_processing/processor.py:
##########
@@ -559,6 +560,28 @@ def update_import_errors(session: Session, dagbag: DagBag) 
-> None:
 
         session.commit()
 
+    @staticmethod
+    def process_dag_warnings(session: Session, dagbag: DagBag) -> None:
+        """
+        For the DAGs in the given DagBag, record any associated configuration 
warnings and clear
+        warnings for files that no longer have them. These are usually 
displayed through the
+        Airflow UI so that users know that there are issues parsing DAGs.
+
+        :param session: session for ORM operations
+        :param dagbag: DagBag containing DAGs with configuration warnings
+        """
+        stored_config_warnings = set(session.query(DagWarning).all())

Review Comment:
   Instead of having to loop through all the DagWarning rows, perhaps we should 
store `configuration_warnings` as an id: DagWarning dict, and do
   
   ```python
   to_delete = session.query(DagWarning).filter(
       DagWarning.id.notin_(dagbag.configuration_warnings),
   )
   ```
   
   instead.



-- 
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