commented unused code
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Andrei Stoica 2023-05-19 18:08:47 -04:00
parent 9d0413ada5
commit c4d5b3a7bf
1 changed files with 7 additions and 3 deletions

View File

@ -64,7 +64,9 @@ def parse_ingredient(
return [text.strip() if text else None for text in m.groups()] return [text.strip() if text else None for text in m.groups()]
def get_missing_ingredients(session): # this code is unused
# TODO: add tests when this is used
def missing_ingredients_query(session):
cte = ( cte = (
except_(select(db.RecipeIngredient.id), select(db.RecipeIngredientParts.id)) except_(select(db.RecipeIngredient.id), select(db.RecipeIngredientParts.id))
).alias("missing") ).alias("missing")
@ -73,8 +75,10 @@ def get_missing_ingredients(session):
) )
return missing return missing
def reparse_ingredients(session): # this code is unused
missing = get_missing_ingredients(session) # TODO: add tests when this is used
def parse_missing_ingredients(session):
missing = missing_ingredients_query(session)
for ingredient in missing: for ingredient in missing:
parts = ingredient_to_parts(ingredient) parts = ingredient_to_parts(ingredient)
session.add(parts) session.add(parts)