diff --git a/openfoodfacts_exports/exports/parquet.py b/openfoodfacts_exports/exports/parquet.py index 46e3582..fdcc928 100644 --- a/openfoodfacts_exports/exports/parquet.py +++ b/openfoodfacts_exports/exports/parquet.py @@ -235,9 +235,10 @@ def ignore_extra_sizes(self): """Literal doesn't accept extra values, returning an error in case of additional keys. """ - self.sizes = { - k: v for k, v in self.sizes.items() if k in ALLOWED_IMAGE_SIZE_KEYS - } + if self.sizes: + self.sizes = { + k: v for k, v in self.sizes.items() if k in ALLOWED_IMAGE_SIZE_KEYS + } return self @model_validator(mode="before")