The core is well put together: the query is parameterized, the date window is half-open, the CSV uses the `csv` module properly, and the functions are small and readable. But two problems stop it merging tomorrow. Any failure is logged and then swallowed, so cron and finance both think the export worked. And it writes every customer's email into the logs. Both are quick to fix.

One thing I couldn't check: the docstring mentions `test_export_job.py`, but that file isn't in this folder, so I couldn't run or review the tests.

## Problems, most severe first

**Blocking**

1. **Failures are silent (lines 56–57).** `except Exception` logs the error and returns normally, so the process exits with code 0. For example, if the finance endpoint returns a 500, cron records success, nobody gets alerted, and finance is missing a day of invoices. Log with `log.exception(...)` and re-raise, or `sys.exit(1)`, so the failure is visible.
2. **Customer emails are logged (line 52).** `[row[1] for row in rows]` puts every paying customer's email into the logs each night. That's personal data in a place with weaker access controls and longer retention. Log the count and maybe the invoice ID range instead.

**High**

3. **The upload has no timeout (line 42).** If the endpoint stops responding, `requests.post` waits forever. The job hangs, the DB connection stays open, and the next night's run overlaps it. Add something like `timeout=(5, 60)`.
4. **Amounts are wrong for some currencies and use floats (line 37).** `amount_cents / 100` assumes every currency has two decimal places. A JPY invoice of 500 (stored as 500, since yen has no minor unit) exports as `5.0` instead of `500`. Three-decimal currencies like KWD come out wrong too. Even for USD, 100 cents exports as `1.0` rather than `1.00`. Use `Decimal` with a per-currency exponent, or export `amount_cents` as-is and tell finance which unit it is.
5. **Timezones are ambiguous (lines 28, 47).** "Yesterday" comes from the server's local clock, and the comparison against `paid_at` uses the DB session's timezone. If those differ from what finance means by "a day", invoices near midnight end up in the wrong file or are missed. Pin both to one timezone, probably UTC, and make sure `paid_at.isoformat()` includes the offset.
6. **There's no way to re-run a missed day (line 47).** The date is always "yesterday". After an outage, you'd have to edit the code to backfill. Accept an optional `--date` argument and default to yesterday.

**Medium**

7. **The tests are thin and the file is missing.** By the docstring's own account, the tests cover only the CSV header and one row. Missing cases: an empty day, upload failure (does it exit non-zero?), DB failure, the amount formatting from #4, and the date window boundaries.
8. **Env vars are read at import time (line 16).** `os.environ["FINANCE_UPLOAD_URL"]` raises `KeyError` as soon as the module is imported, so tests need that variable set just to import it. Read it inside `run()`, as you already do for `DATABASE_URL`.
9. **Logging is never configured.** Nothing calls `logging.basicConfig`, so under cron the two `log.info` lines are dropped. Only warnings and errors reach stderr, through Python's fallback handler. Configure logging in `__main__`.
10. **No retry on upload.** A single network blip loses the day, and with #1 it loses it silently. Two or three retries with backoff would cover it.
11. **The URL may leak into logs.** If `FINANCE_UPLOAD_URL` contains a token, the error from `raise_for_status()` includes the full URL, which line 57 would then log. Check how that endpoint authenticates.

**Minor**

12. **The CSV is written non-atomically.** A crash mid-write leaves a partial file in `/var/exports`. Write to a temp file and `os.replace` it into place.
13. **The export directory is assumed.** `EXPORT_DIR` is hardcoded and its existence isn't checked. Make it configurable and create it if missing.
14. **Empty days upload a header-only file.** That may be what you want; just confirm finance expects it.
15. **The amount column name is unclear.** The header says `amount` but doesn't say whether that's major units or cents. Naming it something like `amount_major` avoids confusion.
16. **No type hints on the four functions.** They'd make the row shape explicit, e.g. `list[tuple[int, str, int, str, datetime]]`.
17. **`fetchall()` loads the whole day into memory.** That's fine at nightly invoice volume; it's only worth revisiting if volume grows a lot.

Fixes 1–3 are a few lines each and are what turn this from not ready into ready with changes. 4–6 depend on what finance expects, so a quick check with them would settle those.

VERDICT: NOT READY
