Dev-iL commented on code in PR #37545:
URL: https://github.com/apache/airflow/pull/37545#discussion_r1494964997


##########
airflow/settings.py:
##########
@@ -27,7 +27,7 @@
 from typing import TYPE_CHECKING, Any, Callable
 
 import pluggy
-from sqlalchemy import create_engine, exc, text
+from sqlalchemy import __version__ as sqlalchemy_version, create_engine, exc, 
text

Review Comment:
   I ended up using try/except after trying, without success, to mock an engine 
(using MagicMock, and sqlalchemy.engine.mock). I couldn't get past the event 
registration which throws the TypeError I ended up catching. It was either that 
or get rid if the test entirely. If you (or anyone else) has an idea how to 
write this test w/o try/except - I'll be happy to hear.
   
   BTW, what's wrong with try/except? I thought EAFP was the preferred way to 
write python code.



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to