Skip to content

UNIC-2179 Add curated step to bd_previnf and reset the anonymized datasets - #1617

Merged
laurabegin merged 1 commit into
masterfrom
feat/UNIC-2179
Sep 23, 2026
Merged

laurabegin merged 1 commit into
masterfrom
feat/UNIC-2179

Conversation

@laurabegin

Copy link
Copy Markdown
Member

Companion to unic-etl#1737, which adds a red/curated step to bd_previnf so the anonymized datasets can upsert on the financial year instead of overwriting the previous one.

The config moves from yellow/anonymized/ to red/curated/, following every other system that has a curated step (etraceline, medecho, pericalm, opera…), and gains a curated step that runs before the anonymized one.

Changes

  • New red/curated step — the 3 curated_bd_previnf_* datasets, gating the anonymized step.
  • run_type: "initial" on the 6 anonymized datasets — the 3 curated-sourced ones change schema and grain, and the other 3 switch OverWrite → Upsert. Since raw is OverWritePartition, every historical partition is still available, so a reset rebuilds the full year history instead of only moving forward.
  • greater_or_equal_partition_counts pre-test on both steps. The test resolves each destination back to its source, so the two cover disjoint tables: the curated one checks the 3 raw tables feeding curated, the anonymized one checks the 3 curated outputs plus the 3 raw tables that bypass curated. Together every bd_previnf source is covered; today none are.
  • xsmall everywhere — all tables hold fewer than 50 rows.

Task graph verified locally: curated.pre_tests → 3 curated tasks → anonymized.pre_tests → 6 anonymized tasks. 171 passed, 0 import errors.

Merge order

Merge unic-etl#1737 first. The pre-tests resolve destinations through Common.mappings, and the curated bd_previnf entries are added there in that PR — without it the pre-test matches no mapping and silently tests nothing.

Deploy notes

  • The DAG is renamed: anonymized_bd_previnf → curated_bd_previnf (the id comes from the config directory). The new DAG is created paused and needs unpausing; the old id keeps its run history.
  • run_type: "initial" is persistent config, so it resets on every monthly run until someone sets it back to default. If the intent is a one-time reset, that needs a follow-up PR after the first successful run.
  • Expect the pre-tests to fail once at a financial-year rollover if the new year ships fewer rows than the previous delivery. It fails safe — nothing is written, clear the task and re-run.

🤖 Generated with Claude Code

@philipbouvrette philipbouvrette left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😮

…ed datasets

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@laurabegin

Copy link
Copy Markdown
Member Author

😮

@philipbouvrette tu m'as fait réalisé que ça avait mal été push. C'est fixed. Là y a des changements.

@laurabegin
laurabegin merged commit 8dbbd3d into master Sep 23, 2026
1 check passed
@laurabegin
laurabegin deleted the feat/UNIC-2179 branch September 23, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants