**This isn't ready to merge tomorrow, but the two blockers are small fixes.** The structure is good: the functions are small, the SQL is parameterized, and the connection is closed in a `finally`. Two problems would cause real harm in production, and the rest are smaller.

## Blockers

1. **Failures are swallowed, so cron reports success.** `run()` (line 56-57) catches every exception, logs one line, and exits 0. If the database is down or the upload returns a 500, finance gets no file and nothing alerts anyone. Remove the `except`, or log the error and re-raise or `sys.exit(1)`. Then cron's own failure mail or monitoring fires.
2. **Customer emails are written to the logs.** Line 52 logs `[row[1] for row in rows]` at INFO, so every paid customer's email goes into the log files every night. That is personal data in a place with weaker access controls, and it gets noisy fast. Log only the count and the date.

## Should fix before or soon after merge

3. **`requests.post` has no timeout (line 42).** A stalled finance endpoint hangs the job forever, and the next night's cron run may overlap with it. Add `timeout=30` or similar.
4. **The date window depends on timezones nobody has pinned down.** `date.today()` uses the cron host's timezone. The query compares `paid_at` to a bare date, which uses the database session's timezone. If those differ, an invoice paid at 23:30 can land in the wrong day's file or in two files. Pick UTC or the business timezone explicitly and use it in both places.
5. **Money goes through float.** `amount_cents / 100` (line 37) produces floats, so large amounts can lose precision. It also assumes every currency has 2 decimal places, which is wrong for JPY (0) or KWD (3). Use `Decimal` and a per-currency exponent, or export `amount_cents` as the integer.
6. **The tests are thin.** The docstring says they cover the CSV header and one row. Missing cases:
   - an empty day
   - the day-boundary query
   - an upload failure
   - a DB failure, which would have caught blocker 1
   - non-ASCII emails or commas in fields

## Minor

7. **`UPLOAD_URL = os.environ[...]` runs at import (line 16).** Importing the module without that variable set, as tests do, raises `KeyError`. Read it inside `run()`, or pass it in.
8. **No logging setup.** There is no `basicConfig`, so under cron the `log.info` lines (including "export finished") are dropped at the default WARNING level. Configure logging in the `__main__` block.
9. **A failed run can leave a partial CSV in `/var/exports`.** Write to a temp file and rename it. The code also assumes the directory exists.
10. **An empty day uploads a header-only file.** That may be what finance wants, but decide on purpose and note it in the docstring.
11. **No way to re-run a past day.** After a failure, a backfill means editing code. An optional `--date` argument fixes that.
12. **`fetchall()` loads everything into memory.** That's fine at today's volume. A server-side cursor would be safer if volume grows.
13. **Spreadsheet formula injection in the CSV.** A value starting with `=`, `+`, `-` or `@` is read as a formula by Excel. Email addresses make this unlikely, but finance probably opens the file in Excel.
14. **`paid_at.isoformat()` crashes if `paid_at` is `NULL`.** The `PAID` filter probably rules that out, but nothing enforces it.
15. **`run()` does fetching, writing, uploading and logging.** It's fine at this size, but passing `day` and the paths in would make it easier to test.

Items 1-3 are each about a one-line change. With those done and a couple of tests for the failure path, this would be in good shape.

VERDICT: NOT READY
