Spreadsheet import: a sheet with no status column, or a blank status cell, turns every undated row into an application #468

Closed
opened 2026-10-01 10:46:55 +00:00 by tiagoagueda · 0 comments
Owner

Found on 2026-09-29 in a read-only review of postulo at 95348908d, reading ParsedRow.becomes and parsing a sheet with no Status column.

Checked again on 2026-10-01 against main at 0a5cad587: still present. The code is now at core/csv_import.py:796 (the default), :843 (the skipped empty cell) and :812-830 (becomes; :830 is the unreachable line); the module docstring, the template and the wiki have not moved.

ParsedRow.status defaults to "applied", and an empty cell is skipped before map_status sees it, so becomes always reaches if self.status: return "application". Its last branch, commented "No status column at all: the date is the only evidence either way", can never run. The #222 change meant a stated, non-draft status to decide; a missing status was meant to fall back to the date, and does not.

  • Where: core/csv_import.py:801 (status: str = "applied"), :848 (if key == "ignore" or not value: continue), :817-835 (becomes; :835 is unreachable). The texts that describe the old rule: templates/core/import_csv.html:34 and the module docstring (core/csv_import.py:7-9) say "rows without one become listings"; the wiki's Backups and your data (step 4 of the spreadsheet import) says the same.
  • What happens: a sheet with only Company, Role and URL columns, a list of jobs to look at, parses to ('applied', 'application') for every row, and perform creates Applied applications with an "Applied on an unknown date" entry and no listings. A row whose Status cell is blank behaves the same.
  • Why it matters: jobs the person never applied to join the open applications, the board and the gone-quiet checks, and Listings, where the page said they would go, stays empty. The only way round it is to add a Status column saying draft on every row.
  • Fix: default status to "" and set it only from a non-empty status cell; becomes then falls back to the date as its comment intends, and perform already uses row.status or "applied". Update the page text, the module docstring and the wiki to the rule the code follows: a stated status decides (draft is a listing, anything else an application), and without one the date decides. Related to #222 (closed), whose CSV change left this case behind.

Done when

  • tests/test_csv_import.py imports a sheet with no Status column and one with a blank Status cell, both without dates, and asserts that each row becomes a listing and no application is created.
Found on 2026-09-29 in a read-only review of postulo at 95348908d, reading `ParsedRow.becomes` and parsing a sheet with no Status column. Checked again on 2026-10-01 against `main` at `0a5cad587`: still present. The code is now at `core/csv_import.py:796` (the default), `:843` (the skipped empty cell) and `:812-830` (`becomes`; `:830` is the unreachable line); the module docstring, the template and the wiki have not moved. `ParsedRow.status` defaults to `"applied"`, and an empty cell is skipped before `map_status` sees it, so `becomes` always reaches `if self.status: return "application"`. Its last branch, commented "No status column at all: the date is the only evidence either way", can never run. The #222 change meant a stated, non-draft status to decide; a missing status was meant to fall back to the date, and does not. - **Where:** `core/csv_import.py:801` (`status: str = "applied"`), `:848` (`if key == "ignore" or not value: continue`), `:817-835` (`becomes`; `:835` is unreachable). The texts that describe the old rule: `templates/core/import_csv.html:34` and the module docstring (`core/csv_import.py:7-9`) say "rows without one become listings"; the wiki's *Backups and your data* (step 4 of the spreadsheet import) says the same. - **What happens:** a sheet with only Company, Role and URL columns, a list of jobs to look at, parses to `('applied', 'application')` for every row, and `perform` creates Applied applications with an "Applied on an unknown date" entry and no listings. A row whose Status cell is blank behaves the same. - **Why it matters:** jobs the person never applied to join the open applications, the board and the gone-quiet checks, and Listings, where the page said they would go, stays empty. The only way round it is to add a Status column saying *draft* on every row. - **Fix:** default `status` to `""` and set it only from a non-empty status cell; `becomes` then falls back to the date as its comment intends, and `perform` already uses `row.status or "applied"`. Update the page text, the module docstring and the wiki to the rule the code follows: a stated status decides (*draft* is a listing, anything else an application), and without one the date decides. Related to #222 (closed), whose CSV change left this case behind. ## Done when - `tests/test_csv_import.py` imports a sheet with no Status column and one with a blank Status cell, both without dates, and asserts that each row becomes a listing and no application is created.
tiagoagueda added this to the 0.5.0 milestone 2026-10-01 10:46:55 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo#468
No description provided.