It's close, but don't merge it as it stands. Three problems need fixing first, and each takes only a few lines. The overall design is good: the query uses placeholders rather than building SQL from strings, each function does one job, the connection is closed in `finally`, and `raise_for_status()` checks the upload response.

## Fix before merging

**1. A failed export looks like a success (`export_job.py:56-57`).** The `except` block logs the error and then the job exits normally with code 0. Cron and any monitoring will report success.
- Example: the finance endpoint returns 503 on the night of 13 Nov. The job logs `export failed: 503 ...` and exits 0. Finance never gets the 13 Nov file, and the next run exports 14 Nov, so nothing re-sends the missing day unless someone reads the logs.
- Fix: keep the log line, but use `log.exception(...)` so the traceback is recorded, then `raise` (or `sys.exit(1)`).

**2. Customer emails are written to the logs (`export_job.py:52`).** `[row[1] for row in rows]` puts every paying customer's email address into the log, every night. That's personal data ending up in logs, which are usually kept longer and shared more widely than the database. Log only the count.

**3. The upload has no timeout (`export_job.py:42`).** If the finance endpoint accepts the connection but never responds, `requests.post` waits forever. The cron job hangs and the next night's run stacks up behind it. Add something like `timeout=(10, 120)`.

## Tests

The docstring says `test_export_job.py` covers the CSV header and one row, but that file isn't in this folder, so I couldn't check it. Either way, those two cases don't test the riskiest paths. Please add:
- the upload or the query fails → the job exits non-zero (this guards fix 1)
- a day with no paid invoices → the file has only the header and still gets uploaded (or whatever behaviour you intend)
- the money formatting described below

Also, `UPLOAD_URL = os.environ[...]` at line 16 runs when the module is imported, so any test that imports the module fails unless that variable is set. Reading it inside `upload()` or `run()` fixes that.

## Questions to settle (they may not block the merge)

- **Money formatting (line 37).** `amount_cents / 100` returns a float, so 1000 cents comes out as `10.0` rather than `10.00`. It's also wrong for any currency that doesn't have 2 decimal places: a ¥500 invoice stored as `500` would be exported as `5.0`. If you only ever invoice in 2-decimal currencies, formatting with `Decimal` to two places is enough. If not, this is a blocker.
- **Timezone for "yesterday" (lines 28, 47).** `date.today()` uses the server's timezone, but the database compares `paid_at` using its own session timezone. If those differ from each other, or from how finance defines a day, invoices paid near midnight get exported on the wrong day or skipped. Make sure all three agree, ideally by setting UTC explicitly.
- **Re-running a missed day.** There's no way to pass in a date, so after a failure you can't re-export that specific day. An optional `--date` argument would fix this, and it's cheap to add once fix 1 means you actually find out about failures.

Once fixes 1 to 3 and the failure-path test are in, I'd be comfortable seeing this merged tomorrow.

VERDICT: READY WITH CHANGES
