You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "/private/tmp/food/.venv/lib/python3.12/site-packages/openfoodfacts/dataset.py", line 108, in count
for _ in self:
File "/private/tmp/food/.venv/lib/python3.12/site-packages/openfoodfacts/dataset.py", line 102, in _csv_iterator
for row in reader:
File "/opt/homebrew/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/csv.py", line 116, in __next__
row = next(self.reader)
^^^^^^^^^^^^^^^^^
_csv.Error: field larger than field limit (131072)
Platform (Desktop, Mobile, Hunger Games)
OS: MacOS Sonoma 14.2
Platform: Desktop
The text was updated successfully, but these errors were encountered:
What
openfoodfacts/dataset.py module uses
csv
library that has a default max field sizethat is less than what is present in the current database
Examining the dataset shows the following max sizes for certain fields
The
ingredients_text
has the largest length of 4688767 on line 1553941.Setting the limit larger than that value, as in follows
csv.field_size_limit(5_000_000)
allows for the API to work.
Steps to reproduce the behavior:
Platform (Desktop, Mobile, Hunger Games)
The text was updated successfully, but these errors were encountered: