Not as-is, but it's close. The structure is good: small functions, a parameterised query, connections closed in `finally`. Three fixes, each a few lines, should go in before you merge tomorrow. A few other points are worth checking but don't need to block the merge.

**Fix before merging**

1. **A failed export looks like a successful one** (`export_job.py:56-57`). The `except` block logs the error and then carries on, so the script exits with code 0. Say the finance endpoint returns a 500 one night: finance gets no file, cron sees a success, and nobody finds out until finance asks. Use `log.exception("export failed")` and then `raise`, so the job exits non-zero and your cron alerts can catch it.

2. **Every customer email goes into the logs** (`export_job.py:52`). `[row[1] for row in rows]` writes each email address from that day into the info log, every night. That's personal data going somewhere it probably isn't meant to be kept. Log just the count:
   `log.info("exporting %d invoices for %s", len(rows), day)`

3. **The upload has no timeout** (`export_job.py:42`). `requests.post` waits forever by default. If the endpoint stops responding, the job hangs and the next night's run piles up behind it. Add something like `timeout=60`.

**Worth checking, not blocking**

- **Tests:** the docstring mentions `test_export_job.py`, but it isn't in this directory, so I couldn't check it. By the docstring's own description it covers only the CSV header and one row. Before merging I'd add tests for:
  - a day with no invoices
  - a failed upload (to prove the job now exits with an error)
  - the date range sent to the query
- **Import-time environment lookup:** `UPLOAD_URL = os.environ[...]` at line 16 runs when the module is imported. Importing it in tests without that variable set raises `KeyError`. Reading it inside `upload()` avoids that.
- **Amount format:** `amount_cents / 100` writes 1000 cents as `10.0`, not `10.00`. Worth checking that finance's importer accepts that. If you ever have currencies without minor units (e.g. JPY), dividing by 100 would be wrong for those. `f"{amount_cents / 100:.2f}"`, or a per-currency exponent, would cover both.
- **Timezone:** `date.today()` uses the server's local time, and Postgres compares `paid_at` against midnight in the database session's timezone. If those differ from the timezone finance uses for "yesterday", invoices paid near midnight will land in the wrong day's file. Worth confirming they all match.

With items 1–3 done, I'd be comfortable merging this.

VERDICT: READY WITH CHANGES
