Skip to content

Commit

Permalink
fix replace_join_with_ingredient_multiple_ingredient
Browse files Browse the repository at this point in the history
  • Loading branch information
parkervg committed Jul 30, 2024
1 parent d9807aa commit b4e308a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions blendsql/parse/_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,16 @@ def replace_join_with_ingredient_multiple_ingredient(
join_alias = ingredient_alias
continue
# Traverse and get the whole ingredient
# We need to go up 3 parents
# We need to go up 2 parents
_parent = anon_child_node
for _ in range(3):
for _ in range(2):
_parent = _parent.parent
assert isinstance(_parent, exp.Expression)
to_return.append(_parent.sql(dialect=FTS5SQLite))
if len(to_return) == 0:
return node
if join_alias == "":
raise ValueError
# temp_uuid is used to ensure a partial query that is parse-able by sqlglot
# This gets removed after
return _parse_one(
Expand Down

0 comments on commit b4e308a

Please sign in to comment.