Skip to content

Commit

Permalink
Test case for c3ec1eb
Browse files Browse the repository at this point in the history
  • Loading branch information
parkervg committed Oct 25, 2024
1 parent c3ec1eb commit c57d513
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/test_single_table_blendsql.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,5 +694,28 @@ def test_null_negation(db, dummy_ingredients):
assert_equality(smoothie=smoothie, sql_df=sql_df)


@pytest.mark.parametrize("db", databases)
def test_cte_with_ingredient(db, dummy_ingredients):
"""c3ec1eb"""
blendsql = """
WITH a AS (
SELECT {{
get_table_size('Table size?', (select * from transactions where amount < 500))
}} AS "size"
) SELECT {{
get_table_size(
'Table size?', (select * from a where a.size > 0)
)
}}
"""
smoothie = blend(
query=blendsql,
db=db,
ingredients=dummy_ingredients,
)
# sql_df = db.execute_to_df(sql)
# assert_equality(smoothie=smoothie, sql_df=sql_df)


if __name__ == "__main__":
pytest.main()

0 comments on commit c57d513

Please sign in to comment.