Skip to content

Conversation

kolok
Copy link
Contributor

@kolok kolok commented Apr 25, 2025

Description succincte du problème résolu

Suite #1521

Notion : Importer le fichier v3 Valdelia (EA, PMCB) dans LVAO - avec table de pivot vers nouvel ID

🗺️ contexte: Airflow - Source

💡 quoi: Ajouter une contrainte d'unicité sur le couple source, identifiant_externe pour les acteurs actifs

🎯 pourquoi: Permettre de se reposer sur ce couple pour identifier les acteurs à mettre à jour

🤔 comment:

  • Migrer les identifiant_externe existant pour ajouter le suffixe _d quand ce sont des acteurs digitaux
  • Ajouter une contrainte d'uniciter pour les acteurs actiifs sur le couple source, identifiant_externe
  • Ajouter le préfixe _d à l'identifiant_externe lors de l'ingestion

Exemple résultats / UI / Data

image

Auto-review

Les trucs à faire avant de demander une review :

  • J'ai bien relu mon code
  • La CI passe bien
  • En cas d'ajout de variable d'environnement, j'ai bien mis à jour le .env.template
  • J'ai ajouté des tests qui couvrent le nouveau code

✅ Reste à faire (PR en cours)

📆 A faire (prochaine PR)

@kolok kolok force-pushed the gestion_duplicates_in_mapping branch from 0c276b6 to b254407 Compare April 25, 2025 08:59
@kolok kolok force-pushed the gestion_duplicates_in_mapping_index branch from d9230eb to cdd9f83 Compare April 25, 2025 08:59
@kolok kolok added the enhancement New feature or request label Apr 25, 2025
@kolok kolok marked this pull request as ready for review April 25, 2025 14:53
@kolok kolok requested a review from a team as a code owner April 25, 2025 14:53
@kolok kolok requested review from fabienheureux and maxcorbeau and removed request for a team April 25, 2025 14:53
Comment on lines +13 to +15
not acteur.identifiant_externe.endswith("_d")
and acteur.identifiant_unique.endswith("_d")
and acteur.identifiant_externe in acteur.identifiant_unique
Copy link
Member

Choose a reason for hiding this comment

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

Comment on lines +17 to +18
acteur.identifiant_externe = f"{acteur.identifiant_externe}_d"
acteur.save()
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@fabienheureux fabienheureux left a comment

Choose a reason for hiding this comment

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

Risque potentiel avec _d qui n'est pas fourni par l'EO

Possibilité de le gérer avec l'unicité basée sur acteur_type mais ne permet pas de garantir l'unicité pour une source (discuté en pair review).

@kolok kolok force-pushed the gestion_duplicates_in_mapping branch from b254407 to e8540d9 Compare April 28, 2025 11:43
Base automatically changed from gestion_duplicates_in_mapping to main April 28, 2025 11:47
Co-authored-by: Fabien Le Frapper <contact@fabienlefrapper.me>
@kolok kolok enabled auto-merge (squash) April 28, 2025 12:25
@kolok kolok disabled auto-merge April 28, 2025 12:26
@kolok kolok merged commit 4ee070c into main Apr 28, 2025
8 of 11 checks passed
@kolok kolok deleted the gestion_duplicates_in_mapping_index branch April 28, 2025 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants