Spot the bug in customer ID export

from Sets
Python 3.14 intermediate 4 min 2 issues to find

Find why this generated helper does not reliably return first-occurrence customer IDs and can fail on incomplete records.

Python
def unique_customer_ids(records):
    ids = {record["customer_id"] for record in records}
    return list(ids)
Open in playground
Report an error