Skip to content

Commit

Permalink
fix: fix bug in spellcheck insights import
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Sep 11, 2024
1 parent 368ee12 commit db73aea
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions robotoff/insights/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1512,11 +1512,15 @@ def _keep_prediction(
return (
# Spellcheck didn't correct
prediction.data["original"] != prediction.data["correction"]
# Modification of the original ingredients between two dataset dumps
# (24-hour period)
and (
product is None
or prediction.data["original"] != product.ingredients_text
or (
# Only keep the prediction if the original ingredient is different
# from the current ingredient list
prediction.data["original"] == product.ingredients_text
# Only keep the prediction if it's for the product main language
and prediction.value_tag == product.lang
)
)
)

Expand Down

0 comments on commit db73aea

Please sign in to comment.