mirror of
https://github.com/MadsLorentzen/ai-job-search.git
synced 2026-11-02 13:12:50 +00:00
fix(salary): convert the IDA workbook again ("Firmanavn og by" header) and list unreachable in the scrape schema (#615)
"firma" joins COMPOUND_PATTERNS so the glued Danish header "Firmanavn og by" matches again; whole-token matching since #75 skipped both sheets of the repository's own demonstration workbook with "Could not find header row". Every other workbook converts byte-identically. Also folds the `unreachable` status from #564 into the seen_jobs.json schema enum in the scrape spec. Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
8123d88f30
commit
5d9e0977f0
4 files changed
+32
-3
No files matched your search
@@ -7,6 +7,7 @@ from salary_lookup import format_entry
|
||||
from tools.convert_salary_excel import (
|
||||
INDEX_PATTERNS,
|
||||
detect_column_type,
|
||||
COMPANY_PATTERNS,
|
||||
header_matches,
|
||||
parse_numeric_cell,
|
||||
parse_sheet,
|
||||
@@ -108,6 +109,22 @@ class DetectColumnTypeTests(unittest.TestCase):
|
||||
companies[0]["categories"]["salary"], {"index": 105.5}
|
||||
)
|
||||
|
||||
def test_parse_sheet_detects_danish_compound_company_header(self):
|
||||
# The IDA workbook heads its company column "Firmanavn og by": "firma"
|
||||
# glued to "navn". Whole-token matching alone skipped the entire sheet
|
||||
# ("Could not find header row") from #75 until "firma" joined
|
||||
# COMPOUND_PATTERNS, so the shipped demonstration data no longer
|
||||
# converted at all.
|
||||
self.assertTrue(header_matches("Firmanavn og by", COMPANY_PATTERNS))
|
||||
ws = FakeWorksheet([
|
||||
("Firmanavn og by", "Antal", "Indeks"),
|
||||
("Example A/S, Aarhus", 12, 105.0),
|
||||
])
|
||||
companies = parse_sheet(ws)
|
||||
self.assertEqual(len(companies), 1)
|
||||
self.assertEqual(companies[0]["company"], "Example A/S, Aarhus")
|
||||
self.assertEqual(companies[0]["categories"]["all_employees"], {"count": 12, "index": 105.0})
|
||||
|
||||
def test_parse_sheet_detects_city_column_with_token_header(self):
|
||||
# City headers are matched with the same token-based header_matches()
|
||||
# used for the company column, not exact string equality. Real-world
|
||||
|
||||
Reference in new issue
Block a user