jscheffl commented on code in PR #65239:
URL: https://github.com/apache/airflow/pull/65239#discussion_r3204701090


##########
airflow-core/src/airflow/utils/db_cleanup.py:
##########
@@ -613,9 +631,22 @@ def run_cleanup(
                     batch_size=batch_size,
                 )
                 session.commit()
+            if ctx.failed:
+                failed_tables.append(table_name)
         else:
             logger.warning("Table %s not found.  Skipping.", table_name)
 
+    if failed_tables:
+        if error_on_cleanup_failure:
+            raise RuntimeError(
+                f"airflow db clean encountered errors on the following tables 
and did not clean them: "
+                f"{failed_tables}. Check the logs above for details."
+            )

Review Comment:
   No, incorrect. As per our rule we should not use AirflowExceptio anymore. So 
this is good in my view.



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