I wouldn't merge this tomorrow as it stands. Two problems would hurt finance or customers on the first bad night, and the tests the file mentions don't exist in this folder. Each fix is small, so it could realistically be ready by tomorrow once they're done.

## Must fix before merge

**1. Failed exports look like successes (`export_job.py:56-57`).**
The `except Exception` logs the error and then lets the script exit normally with code 0. Cron and any monitoring will record the run as a success.
- **Example:** the finance endpoint returns HTTP 500. `raise_for_status()` raises, one line goes to the log, the process exits 0, and finance gets no file. Nobody is alerted.
- **Expected:** the process exits non-zero so cron mail or monitoring catches it.
- **Fix:** use `log.exception(...)` (which keeps the traceback) and then re-raise, or drop the `try/except` and keep only the `finally` around closing the connection.

**2. Every customer email address gets logged (`export_job.py:52`).**
`[row[1] for row in rows]` writes all of yesterday's paying customers' emails into the log on every run. That is personal data sitting in log storage, which usually has wider access and longer retention than the database.
- **Example:** 3,000 invoices produce 3,000 email addresses in one log line.
- **Fix:** log only the count and the day.
- **Note:** nothing calls `logging.basicConfig`, so INFO lines may be dropped today. The leak would start silently as soon as someone configures logging.

**3. The tests the docstring mentions are missing.**
Line 3 says the file is "Tested by test_export_job.py", but that file isn't in this directory. If it lives somewhere else, I haven't seen it. Either way, "CSV header and one row" leaves out the cases that matter. At minimum I'd add:
- An upload failure makes the job fail (exits non-zero), which pins fix #1.
- The log line contains no email addresses, which pins fix #2.
- Amount formatting (see #4).
- The date window: an invoice paid at 23:59:59 yesterday is included, and one at 00:00:00 today is not.

There's also a testability problem. `UPLOAD_URL = os.environ["FINANCE_UPLOAD_URL"]` runs when the module is imported, so a test can't even import it unless that variable is set. Read it inside `upload()` or `run()` instead.

## Should fix

**4. Amounts are floats.** `amount_cents / 100` turns 1000 into `10.0` and 150 into `1.5`, not `10.00` and `1.50`. It is also wrong for currencies without two decimal places: 500 JPY comes out as `5.0`. Use `Decimal` with formatting per currency, or send `amount_cents` as is. Ask finance which format they expect.

**5. The upload has no timeout (`export_job.py:42`).** If the endpoint stops responding, `requests.post` waits forever, and the next night's run piles up behind the stuck one. Add `timeout=` and, ideally, one or two retries.

**6. Which "day" this covers depends on the server's timezone.** `date.today()` uses the server's local timezone, and Postgres compares a `date` against `paid_at` using the database session's timezone. If either one is UTC while finance thinks in local business days, invoices near midnight end up in the wrong file. This needs a decision: confirm with finance which timezone defines "yesterday", then set it explicitly.

## Minor
- `EXPORT_DIR` is hard-coded. Making it an environment variable or parameter would help tests and other environments.
- `psycopg2.connect` is called outside the `try`. That works, but once fix #1 is in, a `with` block or a plain `try/finally` would read more cleanly.

## What's fine
The query is parameterised, so there's no SQL injection risk. The functions are small and each does one thing. The connection is closed reliably. The overall structure is easy to follow.

VERDICT: NOT READY
