Find the record-identity and scale bugs in this bar-chart preparation function.
Python
def chart_rows(records):
labels = [row["region"] for row in records]
values = sorted(row["profit"] for row in records)
domain = (min(values), max(values))
return labels, values, domain