mirror of
https://github.com/MadsLorentzen/ai-job-search.git
synced 2026-09-17 00:26:26 +00:00
fix(salary): detect city column from header token, not exact match (#201)
convert_salary_excel.py detected the city column via exact membership (h_lower in CITY_PATTERNS), so real headers like "City Name", "City/Kommune", or "Kommune <suffix>" never matched and every company was written with an empty city field. Switches to header_matches(h, CITY_PATTERNS) - the same whole-token matcher already used for the company, count, index, and ID columns. Same bug class as #151 (company column); bare "City"/"Kommune" inputs are unaffected. Regression test covers bare and suffixed headers. By @oscarbol09.
This commit is contained in:
@@ -114,10 +114,9 @@ def parse_sheet(ws, sheet_label=None):
|
||||
company_col = None
|
||||
city_col = None
|
||||
for i, h in enumerate(headers):
|
||||
h_lower = h.lower()
|
||||
if header_matches(h, COMPANY_PATTERNS):
|
||||
company_col = i
|
||||
elif h_lower in CITY_PATTERNS:
|
||||
elif header_matches(h, CITY_PATTERNS):
|
||||
city_col = i
|
||||
|
||||
if company_col is None:
|
||||
|
||||
Reference in New Issue
Block a user