jedcunningham commented on code in PR #60938:
URL: https://github.com/apache/airflow/pull/60938#discussion_r2728394659


##########
airflow-core/src/airflow/dag_processing/manager.py:
##########
@@ -690,14 +699,15 @@ def clear_orphaned_import_errors(
         """
         self.log.debug("Removing old import errors")
         try:
-            errors = session.scalars(
-                select(ParseImportError)
-                .where(ParseImportError.bundle_name == bundle_name)
-                .options(load_only(ParseImportError.filename))
+            if not observed_filelocs:
+                
session.execute(delete(ParseImportError).where(ParseImportError.bundle_name == 
bundle_name))
+                return
+            session.execute(
+                delete(ParseImportError).where(
+                    ParseImportError.bundle_name == bundle_name,
+                    ~ParseImportError.filename.in_(observed_filelocs),

Review Comment:
   Can observed_filelocs be prohibitively large?



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