From d8b7d16a16637a5f83f775c25b109a811965afdd Mon Sep 17 00:00:00 2001 From: parkervg Date: Wed, 9 Oct 2024 11:00:27 -0400 Subject: [PATCH] Test case for ee3b0c4 --- tests/test_single_table_blendsql.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/test_single_table_blendsql.py b/tests/test_single_table_blendsql.py index e2f52d76..51bd0399 100644 --- a/tests/test_single_table_blendsql.py +++ b/tests/test_single_table_blendsql.py @@ -673,5 +673,27 @@ def test_group_by_with_ingredient_alias(db, ingredients): assert_equality(smoothie=smoothie, sql_df=sql_df) +@pytest.mark.parametrize("db", databases) +def test_null_negation(db, ingredients): + """ee3b0c4""" + blendsql = """ + SELECT merchant FROM transactions + WHERE merchant IS NOT NULL + AND {{starts_with('Z', 'transactions::merchant')}} + """ + sql = """ + SELECT merchant FROM transactions + WHERE merchant IS NOT NULL + AND merchant LIKE 'Z%' + """ + smoothie = blend( + query=blendsql, + db=db, + ingredients=ingredients, + ) + sql_df = db.execute_to_df(sql) + assert_equality(smoothie=smoothie, sql_df=sql_df) + + if __name__ == "__main__": pytest.main()