-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat(profils): add profils search full text to api #329
base: main
Are you sure you want to change the base?
Conversation
d1a3259
to
6210edf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok 1ère passe ! c'est cool
je n'ai pas vraiment fait la revue de code côté api
avant, est-ce que tu peux ajouter un test dédié, et quelques tests cases ? (sans tester la logique websearch).
pipeline/dbt/models/staging/sources/soliguide/_soliguide__models.yml
Outdated
Show resolved
Hide resolved
pipeline/dbt/models/staging/sources/soliguide/_soliguide__models.yml
Outdated
Show resolved
Hide resolved
pipeline/dbt/models/staging/sources/soliguide/_soliguide__models.yml
Outdated
Show resolved
Hide resolved
pipeline/dbt/models/intermediate/sources/reseau_alpha/int_reseau_alpha__services.sql
Outdated
Show resolved
Hide resolved
pipeline/dbt/models/intermediate/sources/soliguide/int_soliguide__services.sql
Outdated
Show resolved
Hide resolved
pipeline/dbt/models/intermediate/sources/france_travail/int_france_travail__services.sql
Outdated
Show resolved
Hide resolved
pipeline/dbt/models/intermediate/sources/agefiph/int_agefiph__services.sql
Outdated
Show resolved
Hide resolved
pipeline/dbt/models/intermediate/sources/action_logement/int_action_logement__services.sql
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je verrais bien une petite discussion autour du design de cette PR car je ne suis étonné par certains choix:
- introduction d'un nouveau query parameter et son utilisation pour filtrer
- introduction d'un nouveau champ et choix des valeurs possible pour ce dernier
Par ailleur, attention aux refactors purement de doc, de SQLFluff et celui concernant Soliguide, qui me praissent tous mériter leur propre commit voire PR.
pipeline/dbt/models/intermediate/sources/agefiph/int_agefiph__services.sql
Outdated
Show resolved
Hide resolved
pipeline/dbt/models/intermediate/sources/agefiph/int_agefiph__services.sql
Show resolved
Hide resolved
pipeline/dbt/models/intermediate/sources/data_inclusion/int_data_inclusion__services.sql
Outdated
Show resolved
Hide resolved
api/src/alembic/versions/20241028_172223_c947102bb23f_add_profils_autres_field_in_service.py
Outdated
Show resolved
Hide resolved
api/src/alembic/versions/20241028_172223_c947102bb23f_add_profils_autres_field_in_service.py
Outdated
Show resolved
Hide resolved
api/src/alembic/versions/20241028_172223_c947102bb23f_add_profils_autres_field_in_service.py
Outdated
Show resolved
Hide resolved
searchable_index_profils_precisions: Mapped[str | None] = mapped_column( | ||
TSVECTOR, | ||
Computed( | ||
"to_tsvector('french', COALESCE(profils_precisions, ''))", persisted=True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiens, pourquoi ici on ne prend pas en compte profils
contrairement à plus haut ? Ca me parait mériter un commentaire a minima.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bien vu...
Je ne sais pas si ca change grand chose, je ne maitrise pas les arcannes de sqlalchemy mais c'est un oublie de ma part...
Je voudrai bien refaire une dernière passe ces prochains jours une fois les commits réorganisés comme suggéré ! |
69ad921
to
b7ff346
Compare
b7ff346
to
3f6fe40
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, quelques petites remarques !
Je n'approuve pas encore car:
- besoin de discuter notamment sur la question des profils
- quelques petits trucs mineurs a verifier que j'ai relevé
- faut qu'on teste bien tout ça en staging
Chaud pour voir ce que donne aussi ce nouveau champ profil_precisions in situ.
('prison', 'personne sortant de prison', 'sortants-de-detention'), | ||
('student', 'étudiant', 'etudiants'), | ||
('ukraine', 'ukraine', 'personnes-de-nationalite-etrangere') | ||
) AS di_mapping (category, traduction, profils) ON publics.value = di_mapping.category |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jolie syntaxe, je connaissais pas
('handicap', 'personne en situation d''handicap', 'personnes-en-situation-de-handicap'), | ||
('lgbt', 'personne LGBT+', NULL), | ||
('hiv', 'vih personne séropositive', NULL), | ||
('prostitution', 'personne en situation de prostitution', NULL), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on a pas genre "minorité" ou "défavorisé" dans nos profils ? pour info. Autant je comprends que "regular" ou "men" on ait pas de catégorie spéciale, autant pour "lgbt" je suis étonné qu'on ait rien alors qu'on a "femmes" ^^
Enfin, je chipote. Techniquement rien à dire.
('isolated', 'isolé', NULL), | ||
('family', 'famille', 'familles-enfants'), | ||
('couple', 'couple', 'familles-enfants'), | ||
('pregnent', 'enceinte', 'familles-enfants'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pregnAnt non ?
profils AS ( | ||
SELECT | ||
publics.lieu_id, | ||
ARRAY_TO_STRING(ARRAY_AGG(DISTINCT di_mapping.traduction), ',') AS traduction, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ici on joint avec une virgule, a d'autres endroits c'est virgule puis espace. on fait partout pareil ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
j'ai mis partout pareil ,
au cas ou on l'affiche. Ca ne change rien a la recherche full text.
NULL::TEXT [] AS "profils", | ||
NULL::TEXT [] AS "pre_requis", | ||
CASE | ||
WHEN lieux.publics__accueil IN (0, 1) THEN ARRAY_APPEND(profils.profils, 'tout-publics') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sur les tout publics je sens qu'il faut provoquer une discussion avec Antoine & Valentin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oui je crois que j'ai rate l'hebdo ou on devait en parler :(. Je me note d'en parler au daily jeudi!
- not_null | ||
- dbt_utils.not_empty_string | ||
- accepted_values: | ||
values: ['regular', 'asylum', 'refugee', 'undocumented'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
j'ai pas vu refugee dans ton mapping plus haut ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bien vu, il est bien dans la doc, je le rajoute au mapping
- 'prostitution' | ||
- 'prison' | ||
- 'student' | ||
- 'ukraine' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: c'est cool de les mettre dans l'ordre alphabétique tant qu'a faire !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'ai mis dans le meme ordre que la documentation. Je trouve ca plus facile a comparer si jamis ils rajoute des valeurs non ?
3f6fe40
to
8cd7122
Compare
1839739
to
f998dfb
Compare
a1f330a
to
f0e1483
Compare
J'ai rebased pour les migrations alembic |
f0e1483
to
6636864
Compare
6636864
to
8e2ed13
Compare
No description provided.