Skip to content

Commit

Permalink
feat: try to export mobile dumps as gzipped TSV
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Nov 8, 2024
1 parent 0273345 commit 4ac0400
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openfoodfacts_exports/exports/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
logger = logging.getLogger(__name__)

MOBILE_APP_DUMP_DATASET_PATH = (
settings.DATASET_DIR / "en.openfoodfacts.org.products.csv"
settings.DATASET_DIR / "openfoodfacts-mobile-dump-products.tsv.gz"
)

MOBILE_APP_DUMP_SQL_QUERY = r"""
Expand All @@ -37,7 +37,7 @@ def generate_mobile_app_dump(parquet_path: Path, output_path: Path) -> None:
raise FileNotFoundError(f"{str(parquet_path)} was not found.")

with tempfile.TemporaryDirectory() as tmp_dir:
tmp_file_path = Path(tmp_dir) / "mobile_dump.csv"
tmp_file_path = Path(tmp_dir) / "mobile_dump.csv.gz"
query = MOBILE_APP_DUMP_SQL_QUERY.replace(
"{dataset_path}", str(parquet_path)
).replace("{output_path}", str(tmp_file_path))
Expand Down

0 comments on commit 4ac0400

Please sign in to comment.