Skip to content

fix(dataprep): rebuild deces-2026-m09 from INSEE (temporary workaround) - #111

Merged
rhanka merged 1 commit into
mainfrom
fix/dataprep-insee-m09-override
Oct 10, 2026
Merged

rhanka merged 1 commit into
mainfrom
fix/dataprep-insee-m09-override

Conversation

@rhanka

@rhanka rhanka commented Oct 9, 2026

Copy link
Copy Markdown
Member

Why

The data.gouv resource titled deces-2026-m09.txt (2026-10-05) points to …/20261005-122110/deces-2025-m09.txt: byte-identical to the September 2025 file (sha1 8eb03b35…). The data.gouv sync keys files on the URL name, already in storage, so September 2026 was never ingested; prod still serves lastDataset: 2026-m08. Reported upstream: https://www.data.gouv.fr/fr/datasets/fichier-des-personnes-decedees/discussions/?discussion_id=6ac496085fc76144658f417d

INSEE serves the right month (Deces_2026_M09.zip, CSV, 51 437 records, 42 666 deaths in 2026-09).

What

Temporary workaround, scoped by packages/deces-dataprep/insee-overrides.list:

  • new datagouv-insee-overrides step, prerequisite of datagouv-to-storage: for each listed month absent from storage, download the INSEE archive, convert it with insee-csv-to-txt.awk (awk, no new dependency), recode to latin1 as the sync does, gzip, push under the data.gouv name
  • guards: CSV header, 9 fields per record, record count, and the dominant death month must match the file name (the check that would have caught the data.gouv mix-up)
  • idempotent: skipped once the file is in storage (the remote worker reruns full-check)
  • list and awk script are outside tagfiles.version: dropping the entry once data.gouv is fixed does not change DATAPREP_VERSION

Validation

  • Deces_2026_M08.csv converted == data.gouv deces-2026-m08.txt byte for byte (sha1 0d2a9fb7…), and == stored deces-2026-m08.txt.gz once recoded to latin1
  • target run against stubbed storage: builds and pushes deces-2026-m09.txt.gz (51 437 records), skips on second run, fails on a month mismatch

Expected effect

deces-2026-m09.txt.gz enters FILES_TO_PROCESS → new data hash (and new DATAPREP_VERSION, Makefile is tagged) → full rebuild and prod release on the next dataprep-monthly run.

The data.gouv resource titled deces-2026-m09.txt serves deces-2025-m09.txt
(same sha1 8eb03b35, deaths of September 2025). The sync keys files on the
URL name, which is already in storage, so September 2026 was never ingested
and prod stayed on 2026-m08.

INSEE publishes the right month as CSV. A new datagouv-insee-overrides step,
run before the data.gouv sync, rebuilds the listed months in the data.gouv
fixed-width layout, recodes them to latin1 like the sync does, and stores them
under the data.gouv name, so FILES_TO_PROCESS picks them up unchanged.

- the conversion reproduces data.gouv deces-2026-m08.txt byte for byte, and
  the stored deces-2026-m08.txt.gz once recoded
- the step fails if the record count differs or if the archive mostly holds
  deaths of another month than the file name says
- it is skipped once the file is in storage, so the remote worker's own
  full-check is a no-op
- the list and the awk script live outside tagfiles.version: removing the
  entry later does not change DATAPREP_VERSION
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0b683328-6380-465e-b6cc-0b001d8ec30e

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rhanka
rhanka merged commit 94c0a83 into main Oct 10, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant