**Not mergeable as written, but four small fixes make it mergeable tomorrow.** I read `export_job.py` only; I ran nothing and did not open `test_export_job.py`, so the test comments rest on the docstring's description.

## Must fix before merge

1. **A failed export looks like a success to cron.** `run()` catches every exception, logs one line and returns normally (`export_job.py:56-57`), so the process exits 0.
   - Example: the finance endpoint returns 503 at 02:00. Expected is a non-zero exit and an alert; actual is exit 0, no file at finance, and one stderr line with no traceback.
   - Fix: use `log.exception(...)` and re-raise, or `sys.exit(1)`.

2. **Customer emails are written to the log.** Line 52 logs the full list of `customer_email` values for every run. Log the count and the day only.

3. **The upload can hang forever.** `requests.post` at line 42 has no `timeout`. If the endpoint accepts the connection and stalls, the job never finishes and never fails. Add something like `timeout=(10, 120)`.

4. **Tests cover only the CSV header and one row.** By your own standards the following need tests:
   - the date window in `fetch_invoices` (start inclusive, end exclusive);
   - `upload` raising on a non-2xx response;
   - `run` exiting non-zero on failure;
   - an empty day.

## Check before merge

- **Which timezone "yesterday" means.** `date.today()` uses the cron host's clock, and the `paid_at` comparison uses the database session's timezone. If `paid_at` is `timestamptz` and the two differ from finance's timezone, invoices near midnight land in the wrong day's file. I can't see the column type or server settings from here.
- **Whether `amount_cents / 100` is right for every currency.** A JPY invoice stored as 500 exports as `5.0`, because yen has no minor unit. Amounts also format inconsistently (`19.99`, `10.5`, `1.0`), and a NULL amount crashes the run. If you only bill in two-decimal currencies, formatting with `f"{amount_cents / 100:.2f}"` is enough.

## Worth doing, can follow the merge

- **No backfill path.** The day is hard-coded to yesterday, so recovering a missed night means editing code. Accept an optional date argument.
- **No logging setup.** Nothing calls `logging.basicConfig`, so when run as a script the two `log.info` lines are dropped and only errors reach stderr.
- **`FINANCE_UPLOAD_URL` is read at import (line 16).** Importing the module without it raises `KeyError`, which makes testing awkward, and `DATABASE_URL` is read inside `run()`. Read both in `run()`.
- **CSVs with customer emails accumulate in `/var/exports`.** There is no cleanup and the files get default permissions. A crash mid-write also leaves a partial file under the final name.

The SQL is parameterised, the connection is always closed, and the fetch, write and upload functions are small and separate.

VERDICT: READY WITH CHANGES
