johncmerfeld commented on code in PR #43978:
URL: https://github.com/apache/airflow/pull/43978#discussion_r1853239472


##########
tests/utils/test_db.py:
##########
@@ -251,3 +252,16 @@ def test_alembic_configuration(self):
         import airflow
 
         assert config.config_file_name == 
os.path.join(os.path.dirname(airflow.__file__), "alembic.ini")
+
+    def test_bool_lazy_select_sequence(self):
+        class MockSession:
+            def __init__(self):
+                pass
+
+            def scalar(self, stmt):
+                return None
+
+        t = Table("t", MetaData(), Column("id", Integer, primary_key=True))
+        lss = LazySelectSequence.from_select(select(t.c.id), order_by=[], 
session=MockSession())
+
+        assert not bool(lss)

Review Comment:
   So really this is a case where either the assertion is true or an exception 
is raised. Perhaps there is a more explicit way to test this, or I could add a 
comment. Whatever you think is best!



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