potiuk commented on code in PR #38707:
URL: https://github.com/apache/airflow/pull/38707#discussion_r1560846808


##########
airflow/providers/common/sql/hooks/sql.py:
##########
@@ -111,6 +112,15 @@ def fetch_one_handler(cursor) -> list[tuple] | None:
         return None
 
 
+@contextmanager
+def suppress_and_warn(*exceptions: type[BaseException]):
+    """Context manager that suppresses the given exceptions and logs a warning 
message."""
+    try:
+        yield
+    except exceptions as e:
+        warnings.warn(f"Exception suppressed: {e}\n{traceback.format_exc()}", 
category=UserWarning)
+
+

Review Comment:
   (BTW. I am also super happy to help in implementing/reviewing 3) as long as 
somoene takes a lead there) 



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