Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When deleting all nutrients, some computed values are kept in DB #10933

Open
raphael0202 opened this issue Oct 24, 2024 · 1 comment
Open

When deleting all nutrients, some computed values are kept in DB #10933

raphael0202 opened this issue Oct 24, 2024 · 1 comment

Comments

@raphael0202
Copy link
Contributor

raphael0202 commented Oct 24, 2024

When we remove all nutrients from a product using the web version, we still have the following (computed values) in the nutriments field:

{
    "nutriments": {
        "carbon-footprint-from-known-ingredients_100g": 50.336,
        "carbon-footprint-from-known-ingredients_product": 252,
        "carbon-footprint-from-known-ingredients_serving": 27.2,
        "fruits-vegetables-legumes-estimate-from-ingredients_100g": 0,
        "fruits-vegetables-legumes-estimate-from-ingredients_serving": 0,
        "fruits-vegetables-nuts-estimate-from-ingredients_100g": 0,
        "fruits-vegetables-nuts-estimate-from-ingredients_serving": 0,
        "nova-group": 1,
        "nova-group_100g": 1,
        "nova-group_serving": 1,
        "nutrition-score-fr": -7,
        "nutrition-score-fr_100g": -7
    }
}

In Robotoff, I added a special case to consider the product nutrients as missing if there are only these keys: openfoodfacts/robotoff@0e4aff3.

@stephanegigandet
Copy link
Contributor

@raphael0202 We chose to have some computed values in the nutriments field, so this behaviour is normal. It is useful in particular for easing the creation of graphs and search filters. We could decide to do it differently in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To discuss and validate
Development

No branches or pull requests

2 participants