openfoodfacts / openfoodfacts-server

Open Food Facts database, API server and web interface - 🐪🦋 Perl, CSS and JS coders welcome 😊 For helping in Python, see Robotoff or taxonomy-editor
http://openfoodfacts.github.io/openfoodfacts-server/
GNU Affero General Public License v3.0
658 stars 387 forks source link

Salt value divided by 1000 in some 3rd party edits #2945

Closed stephanegigandet closed 4 years ago

stephanegigandet commented 4 years ago

Yuka has been sending us salt values divided by 1000 (e.g. "nutriment_salt":"0.0017" with no unit specified (which makes it "g")). This has been going on for some time (~ January 25th 2020) but it did not happen with all edits.

Finding the affected edits is not obvious. I added data quality facets for low salt values. They have been computed for products edited by Yuka / kiliweb in the corresponding period:

Data quality Products *
nutrition-value-under-0-1-g-salt 9351 *
nutrition-value-under-0-001-g-salt 4342 *
nutrition-value-under-0-01-g-salt 4233 *

Not all of those products are affected by the bug. Most values < 0.1g but >= 0.01 g are correct. (but not all).

Most values < 0.01 g seem incorrect, but not all.

Action plan:

  1. Stop new bad values.
  1. Fix broken values

Apply similar logic.

stephanegigandet commented 4 years ago

Affected or possibly affected products:

image

Data quality Products *
yuka-salt-bug-new-salt-value-less-than-0-001-g 3841 *
yuka-salt-bug-new-salt-value-less-than-0-01-g 3495 *
yuka-salt-bug-new-salt-value-less-than-0-1-g 2654 *
yuka-salt-bug-salt-value-divided-by-more-than-100 843 *
stephanegigandet commented 4 years ago

Fixed.