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

[IMPORT] Embed reusable import module into GeoNature core #2833

Merged
merged 521 commits into from
Oct 28, 2024

Conversation

bouttier
Copy link
Contributor

@bouttier bouttier commented Dec 18, 2023

Reste à faire avant merge :

PR restantes :

Améliorations frontend :

  • Rapport d’import : le périmètre géographique est un rectangle très peu haut, pas très lisible …
  • Liste d’import : bouton de téléchargement des données invalides : ne s’affiche pas et le lien est faux (manque la destination)
  • Rapport d’import PDF [IMPORT] update import report  #3223 :
    • Remplacer « date d’import : none » par « en cour » si import non terminé
    • Ne pas afficher la bbox ni les erreurs si import non vérifié
    • Ne pas afficher les stats si import non terminé
    • Correspondance de valeurs : remplacer « null » par « pas de valeur » (en italique) (pas possible normalement)
    • Correspondance des champs : ne pas afficher les champs non mappé + corriger l’inversion champs source <> champs cible

Juste avant de merge :

  • Supprimer la CI sur les branches de dev
  • Merge de la dernière develop sur feat/import
  • Linéariser les migrations alembic

À vérifier :

  • Pouvoir sauter le field mapping et le content mapping (utilisation de DEFAULT_FIELD_MAPPING_ID et DEFAULT_CONTENT_MAPPING_ID) (cas d’usage GINCO) > pas sûr qu’on en ait encore beaucoup usage
  • Virer le metaclass_resolver si encore présent dans le code source)
  • Vérification de l’existence des UUID : un paramètre permet de rechercher uniquement dans un JDD (propre à dépobio qui a autorisé les duplicats d’UUID inter-jdd dans la synthèse - et pour des raisons de performances). Cassé avec les jdd ligne par ligne ! [@bouttier]

Non bloquant :

  • Fonctionnel mais non conforme aux discussion : lorsqu’une station est dupliquée, les erreurs ne sont levées que sur la première occurrence de la station et non pour l’ensemble des lignes. Est-ce qu’on valide ce comportement ou est-ce qu’on planifie de reprendre pour lever une erreur par ligne ?

Pour le futur :

  • Rajouter une alternative au cd_hab : code typo (cd_typo ou cd_table) + lb_code [issue à ouvrir]
  • Dans la liste des imports, si l’on filtre par une destination donnée puis que l’on crée un nouvel import, la destination pourrait être pré-sélectionnée.

@bouttier bouttier force-pushed the feat/import branch 6 times, most recently from f3fc016 to e459ff4 Compare December 22, 2023 16:01
Copy link

codecov bot commented Dec 22, 2023

Codecov Report

Attention: Patch coverage is 88.31169% with 315 lines in your changes missing coverage. Please review.

Project coverage is 83.86%. Comparing base (46ecee3) to head (33caae6).

Files with missing lines Patch % Lines
backend/geonature/core/imports/routes/imports.py 85.07% 60 Missing ⚠️
backend/geonature/core/imports/models.py 88.30% 42 Missing ⚠️
...le_occhab/backend/gn_module_occhab/imports/plot.py 31.66% 41 Missing ⚠️
backend/geonature/core/gn_synthese/imports/plot.py 26.08% 34 Missing ⚠️
...nd/geonature/core/imports/checks/dataframe/cast.py 77.77% 30 Missing ⚠️
backend/geonature/core/imports/utils.py 90.78% 21 Missing ⚠️
backend/geonature/core/imports/routes/__init__.py 62.50% 9 Missing ⚠️
backend/geonature/core/imports/tasks.py 86.15% 9 Missing ⚠️
backend/geonature/core/imports/admin.py 82.60% 8 Missing ⚠️
backend/geonature/core/imports/actions.py 77.41% 7 Missing ⚠️
... and 18 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2833      +/-   ##
===========================================
+ Coverage    81.95%   83.86%   +1.91%     
===========================================
  Files           86      122      +36     
  Lines         6965     9646    +2681     
===========================================
+ Hits          5708     8090    +2382     
- Misses        1257     1556     +299     
Flag Coverage Δ
pytest 83.86% <88.31%> (+1.91%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

bouttier and others added 14 commits September 20, 2024 00:01
…lay to true.

This is required for testing the dataset mapping field even though it is deactivated for the moment.
feat(import) : add check for habitat technical collection 

Co-authored-by: jacquesfize <jacques.fize@ecrins-parcnational.fr>
* feat(import, report): refact of the report design
* feat(import, report): change/add condition to display certain element in the import report pdf
* fix(import, report) : fix inversion between source and destination field + hide field not mapped
* feat(import): extending jdd checks by verifying its active status
#3209)

* feat(import,check) : when an habitat is imported on existing station, we now check permissions on the latter
* feat(occhab): change `Station.filter_by_scope()`  signature, now return a whereclause
* feat(import) : add method to Destination to filter by a user's permission + change GET route /destinations/
* feat(model, Destination) : add an `has_instance_permission()` method to the `Destination` class
* feat(import,destination): adapt `pnx-destination` component with the new route
…eneric link to destination module in the import report (#3207)

* feat(report) link from import report to occhab, and filter on id_import

---------

Co-authored-by: jacquesfize <jacques.fize@ecrins-parcnational.fr>
Copy link
Contributor Author

@bouttier bouttier left a comment

Choose a reason for hiding this comment

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

Clairement plus propre avec un id_import en synthèse !!

jacquesfize and others added 8 commits October 21, 2024 13:21
* complete migration from import V2 to V3 revision

* change ORM query to SQL TEXT ones

* wip

* fix(migration): remove unused DELETE query
* feat(import): move import count to statistics
* feat(import) : add migration to drop import_count
* feat(migration): modify revision to include import_count transfer data to statistics + fix notification template revision
* fix(test): impact the deplacement of `import_count` into `TImports.statistics`
* feat(import,synthese): remove unused value computation + increase timeout for forntend test
…d in existing station + make `computing_bounding_box` generic (#3236)

* feat(import, occhab) : Extend the bbox computation to habitat import in existing station
* feat(test): add unit test for the occhab bbox computation
* feat(import) : make `computing_bounding_box` generic
* feat(doc): complete comments + rename variables -> `compute_bounding_box`
---------

Co-authored-by: jacquesfize <jacques.fize@ecrins-parcnational.fr>
Pierre-Narcisi and others added 4 commits October 28, 2024 15:26
* feat(clean): parse queries to sqla2.0 style
* feat(doc): add docstring
* feat(import) : move occhab plot in a dedicated file
* feat(model, import): add Marshmallow Schema for MappingTemplate
* feat(import,report) : change title of the occhab plot
* fix(import) : fix altitude bug
* feat(import, report plot): clarify plot + debug missing plot in pdf report
* fix(import, list) : correct typo in default mapping + add nb_line_valid in statistics + minor corrections in import list UI
* fix(test) : apply name change to previously named column 'Voir la fiche du JDD'

---------

Co-authored-by: Élie Bouttier <bouttier@users.noreply.github.com>
@Pierre-Narcisi Pierre-Narcisi merged commit 2ee67f9 into develop Oct 28, 2024
8 checks passed
@Pierre-Narcisi Pierre-Narcisi deleted the feat/import branch October 28, 2024 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

7 participants