**It's close.** The structure is good: query, CSV writing, upload and orchestration are separate small functions, and the connection is always closed. Two small fixes should go in before you merge, and the rest can follow.

**Fix before merging**

1. **Failures exit as success.** `run()` catches every exception at `export_job.py:56-57`, logs it, and returns normally. Cron then sees exit code 0.
   - Example: the finance endpoint is down at 02:00. The upload raises, the log gets one line, and cron reports success. Finance never gets the file and nobody is alerted.
   - Fix: re-raise after logging (`log.exception(...)` then `raise`). You can also drop the `except` and let `finally` close the connection.

2. **Customer emails go into the logs.** Line 52 logs `[row[1] for row in rows]`, which is every customer email for the day, every night. Log files usually have wider access and longer retention than the invoices table.
   - Fix: log only the count, which is already there.

**Worth doing soon, not blocking**

- **No timeout on the upload** (line 42). If the endpoint hangs, the job hangs indefinitely. Add `timeout=30`.
- **Amount formatting** (line 37). `amount_cents / 100` is a float. For example, 1999 becomes `19.99` and 100 becomes `1.0`. Some values can also print oddly. Finance may expect two decimals, so consider `f"{amount_cents / 100:.2f}"` or `Decimal`.
- **Timezone.** `date.today()` uses the server's local date, and the query compares `paid_at` against bare dates. If `paid_at` is stored in UTC and the server isn't, "yesterday" can be off by hours. Confirm both use the same zone.
- **Import-time env var.** `os.environ["FINANCE_UPLOAD_URL"]` at line 16 makes the module fail on import if it's unset, which makes it awkward to test. Reading it inside `upload()` fixes that.
- **Tests.** The header says tests cover the CSV header and one row. Nothing covers the failure path, an empty day, or the date boundaries. A test that `run()` raises when the upload fails would lock in fix 1.

VERDICT: READY WITH CHANGES
