Taragolis commented on code in PR #38707:
URL: https://github.com/apache/airflow/pull/38707#discussion_r1561583638
##########
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:
There is two opinions fights to each other inside me:
First one told me: "hey! It would be awesome! It'll reduce codebase and
might solve common mistake"
The second one whisper: "look at common sql, one simple change in common
utility and it introduce bug in 50+ providers"
--
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]