The structure is clean and easy to follow. Fetch, write and upload are separate functions, the query is parameterized, `newline=""` is set correctly, and the file handle is closed properly. The problems below are mostly small fixes, but two of them should block the merge.

## Ranked problems

**High (fix before merge)**

1. **Failures are swallowed, so cron never sees them.** `run()` catches every exception, logs one line, and exits with status 0. If the database is down or the upload returns a 500, finance gets no file and nobody is alerted. Example: the finance endpoint returns 503 at 02:00. The job logs "export failed", cron reports success, and the gap is found days later. Re-raise after logging, or call `sys.exit(1)`. Use `log.exception` so the traceback is kept.
2. **Customer emails are written to the logs** (line 52). That line prints every paying customer's address into the log, which is personal data going to a place with weaker access controls than the database. Log the count and the day only.

**Medium**

3. **Day boundaries depend on timezone** (lines 47 and 28). `date.today()` uses the server's local time, and a plain date is compared against `paid_at`, so the cutoff depends on the DB session timezone. If the server is UTC and finance expects US-Eastern days, invoices paid late in the evening land in the wrong day's file. Pick one timezone explicitly and pass timezone-aware bounds.
4. **Money goes through floats** (line 37). `amount_cents / 100` writes `10.1` instead of `10.10` for 1010 cents. It is also wrong for currencies without two decimal places, such as JPY. Use `Decimal` and format by currency exponent.
5. **`requests.post` has no timeout** (line 42). A stalled endpoint hangs the job forever, and cron may stack up runs behind it. Add `timeout=`.
6. **No retry, and reruns aren't safe.** A transient network error fails the whole night. A manual rerun overwrites the file and re-uploads, and I can't tell whether the endpoint de-duplicates. Add a small retry on upload and confirm idempotency with finance.
7. **Test coverage is thin.** The docstring says the tests cover the CSV header and one row. Nothing covers `fetch_invoices`, `upload`, the failure path, an empty day, or the day-boundary behavior. The failure-path test would have caught problem 1.
8. **Logging isn't configured.** There is no `basicConfig`, so under cron the `info` lines are dropped. Only the error line shows up, on stderr.

**Low**

9. **`UPLOAD_URL = os.environ[...]` runs at import time.** Importing the module without that variable raises `KeyError`, which makes tests awkward. Read it inside `run()`, or pass it in.
10. **`psycopg2.connect` is outside the `try`** (line 49). A connection failure behaves differently from every other failure. Once problem 1 is fixed this matters less.
11. **CSV formula injection.** An email starting with `=`, `+`, `-` or `@` runs as a formula if finance opens the file in Excel. Low risk, but cheap to guard against.
12. **The export file holds customer data with default permissions**, and old files are never cleaned up from `/var/exports`. `EXPORT_DIR` is hardcoded and never created.
13. **Empty days upload a header-only file.** That is probably fine, but confirm finance expects it.
14. **Rows are unpacked by position** (line 36). Reordering the `SELECT` columns silently shifts the CSV. A `DictCursor` or a named tuple would be safer.
15. **No authentication is visible on the upload.** If the endpoint needs a token, it isn't here. If it doesn't, that is worth a conscious decision.

## What to do next

Problems 1 and 2 are each about a one-line change, plus a test for the failure path. With those done and a timeout added (problem 5), I'd be comfortable merging. The timezone and money handling (problems 3 and 4) can follow in a fast second PR if you want to hold the deadline. If you do, note the debt in the PR description.

VERDICT: NOT READY
