Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Archivage - hydratation de la table EmailLastSeen avec les données existantes #895

Open
5 of 7 tasks
vincentporte opened this issue Jan 27, 2025 · 1 comment
Open
5 of 7 tasks
Assignees
Labels
python Pull requests that update Python code

Comments

@vincentporte
Copy link
Contributor

vincentporte commented Jan 27, 2025

Données de creation de :

  • Post
  • DSP
  • Event
  • Upvote
  • ForumRating pour les utilisateurs authentifiés

Données de mise à jour de :

  • Click on notifi (visited_at non nul)

Données de connection de :

  • User
@vincentporte vincentporte self-assigned this Jan 27, 2025
@vincentporte vincentporte added the python Pull requests that update Python code label Jan 27, 2025
@vincentporte
Copy link
Contributor Author

  1. collecter tous les evenements sous forme d'une liste de tuples
    data = [('[email protected]',datetime(2024,10,10),'LOGGED'),('[email protected]',datetime(2024,8,3),'POST'),('[email protected]',datetime(2025,1,10),'LOGGED'),('[email protected]',datetime(2024,10,10),'LOGGED'),('[email protected]',datetime(2024,8,3),'POST'),('[email protected]',datetime(2025,1,18),'LOGGED'),('[email protected]',datetime(2023,10,10),'LOGGED')]

  2. dedupliquer la liste en conservant l'évenement le plus récent pour chaque email
    dedup_tups = {tup[0]: tup for tup in sorted(data, key=lambda tup: (tup[0], tup[1]), reverse=True)}

  3. exclure les emails déjà connus de EmailLastSeen

  4. generer les objets EmailLastSeen avec les tuples restant

  5. bulk_create

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests that update Python code
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant