Job titles: gendered ESCO names are indexed whole, so a French, German or Portuguese title rarely gets a code #533
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#533
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found on 2026-09-29 in a read-only review of postulo at
95348908d, readingjobs/esco.pyand runningcode_foragainst the downloadedesco-1.2.1.json.Checked again on 2026-10-01 against
mainat0a5cad587: still present. The code is now atjobs/models.py:969-976(JobPosting.save);jobs/esco.pyandfetch_esco.pyhave not changed.ESCO's preferred label for an occupation in a gendered language holds both forms in one string, separated by a slash:
développeur de chaînes de blocs/développeuse de chaînes de blocs,Cloud-Ingenieur/Cloud-Ingenieurin.fetch_escostores the label as it comes, and_occupations_by_nameindexes only the whole string, so a title a person actually types, in one form, never matches an occupation. #266 promised that a title typed in the reader's language is found among the occupation names; for most of the classification in most gendered languages it is not.jobs/esco.py:200-212(_occupations_by_name: one key per occupation, the whole label,.casefold()only);jobs/esco.py:224-245(code_for: an exact.get(folded)and no other form);jobs/management/commands/fetch_esco.py,Command._labels(keeps the label whole);jobs/models.py:966-973(JobPosting.savesetsisco_codefrom it).waiter/waitress).code_for("développeur de logiciels", "fr"),code_for("Développeuse de logiciels", "fr")andcode_for("Programador de software", "pt")all return'';code_for("programador de software/programadora de software", "pt")returns'2512';code_for("waiter", "en")returns''. A listing titled in one form therefore carries no ISCO-08 code unless the title happens to equal the unit group's own (usually plural) name._position_named(jobs/esco.py:419) treats the same ambiguity among skills as no match._occupations_by_name, index each form of a label separately: split on/, index each non-empty half, and keep the whole label as well (for the few labels with other slashes). A folded name that points at more than one unit group matches nothing, as for skills, and the docstring says so. Fold both sides with_fold(NFKC, collapsed spaces) rather thanstrip().casefold(), so a title with a double space or a decomposed accent still matches.Done when
tests/test_esco.pyhas a test with a fixture occupation labelleddéveloppeur de logiciels/développeuse de logicielsinfrthat expects bothcode_for("Développeur de logiciels", "fr")andcode_for("développeuse de logiciels", "fr")to return its code; it fails today.code_forreturns''; it fails today.