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


##########
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:
   so, this is always gonna be a small amount of data.  and, in any case we 
already always hold all current dag warnings in memory; every warning that was 
emitted in the course of the dagbag load gets stored on an attr and then we 
just have to sync that with the db. similar is done for importerror.
   
   which part are you thinking needs to be optimized?  the "delete stale 
warnings" operation?
   



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