Skip to content

Commit

Permalink
test case for af86714
Browse files Browse the repository at this point in the history
  • Loading branch information
parkervg committed Jul 30, 2024
1 parent af86714 commit c79811c
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/test_multi_table_blendsql.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,3 +631,36 @@ def test_infer_options_arg(db, ingredients):
)
sql_df = db.execute_to_df(sql)
assert_equality(smoothie=smoothie, sql_df=sql_df)


@pytest.mark.parametrize("db", databases)
def test_join_with_multiple_ingredients(db, ingredients):
"""
af86714
"""
blendsql = """
SELECT "Run Date", Action, portfolio.Symbol FROM account_history
JOIN {{
do_join(
right_on='account_history::Symbol',
left_on='portfolio::Symbol'
)
}} AND {{
starts_with('H', 'portfolio::Description')
}} AND {{
get_length('length', 'account_history::Security Description')
}} > 3
"""
sql = """
SELECT "Run Date", Action, portfolio.Symbol FROM account_history
JOIN portfolio ON account_history.Symbol = portfolio.Symbol
WHERE portfolio.Description LIKE 'H%'
AND LENGTH(account_history."Security Description") > 3
"""
smoothie = blend(
query=blendsql,
db=db,
ingredients=ingredients,
)
sql_df = db.execute_to_df(sql)
assert_equality(smoothie=smoothie, sql_df=sql_df)

0 comments on commit c79811c

Please sign in to comment.