From 043b96c3f64507e860edab04eb4a3eabb692c415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Bournhonesque?= Date: Tue, 29 Aug 2023 15:54:09 +0200 Subject: [PATCH] fix: disable temporarily en:eu-non-agriculture and en:eu-agriculture See https://github.com/openfoodfacts/robotoff/issues/1245 --- robotoff/insights/importer.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/robotoff/insights/importer.py b/robotoff/insights/importer.py index dbb0f09050..a96fa33452 100644 --- a/robotoff/insights/importer.py +++ b/robotoff/insights/importer.py @@ -740,6 +740,10 @@ def is_prediction_valid(product: Optional[Product], tag: str) -> bool: # Predictions are always valid when product check is disabled # (product=None) return True + # We disable temporarily en:eu-agriculture and en:non-eu-agriculture + # See https://github.com/openfoodfacts/robotoff/issues/1245 + if tag in ("en:eu-agriculture", "en:non-eu-agriculture"): + return False return not ( tag in product.labels_tags or LabelInsightImporter.is_parent_label(tag, set(product.labels_tags))