Description
transform_evaluation_response only adds the name, email, phone, location, summary and all *_url / *_username columns when resume_data.basics is truthy:
https://github.com/interviewstreet/hiring-agent/blob/70fd3ea/transform.py#L516
There is no else branch filling them with empty values. score.py then appends the row using that row's own keys as fieldnames, and only writes a header when the file is new:
https://github.com/interviewstreet/hiring-agent/blob/70fd3ea/score.py#L349-L360
So a resume whose basics section failed to parse (see also the Basics validation issue) produces a 31-column row, which is appended under a 46-column header. Every value after file_name shifts into the wrong column (e.g. total_work_experience lands under name), silently corrupting resume_evaluations_<role>.csv.
Steps to reproduce
r1 = JSONResume(basics={"name": "A", "profiles": []})
r2 = JSONResume(work=[{"name": "X"}])
k1 = list(transform_evaluation_response("a.pdf", r1, {}, ev, role).keys())
k2 = list(transform_evaluation_response("b.pdf", r2, {}, ev, role).keys())
print(len(k1), len(k2), k1[1], k2[1])
# 46 31 name total_work_experience
Related (same function)
location is formatted as f"{basics.location.city}, {basics.location.region}" (L521-L525), which writes the literal string "None, None" when only e.g. countryCode was extracted.
Expected
- Every row has the same column set in the same order (fill missing values with
""), or DictWriter uses a fixed fieldnames list per role.
- Location joins only non-empty parts.
Description
transform_evaluation_responseonly adds thename,email,phone,location,summaryand all*_url/*_usernamecolumns whenresume_data.basicsis truthy:https://github.com/interviewstreet/hiring-agent/blob/70fd3ea/transform.py#L516
There is no
elsebranch filling them with empty values.score.pythen appends the row using that row's own keys asfieldnames, and only writes a header when the file is new:https://github.com/interviewstreet/hiring-agent/blob/70fd3ea/score.py#L349-L360
So a resume whose basics section failed to parse (see also the
Basicsvalidation issue) produces a 31-column row, which is appended under a 46-column header. Every value afterfile_nameshifts into the wrong column (e.g.total_work_experiencelands undername), silently corruptingresume_evaluations_<role>.csv.Steps to reproduce
Related (same function)
locationis formatted asf"{basics.location.city}, {basics.location.region}"(L521-L525), which writes the literal string"None, None"when only e.g.countryCodewas extracted.Expected
""), orDictWriteruses a fixed fieldnames list per role.