If your billing pipeline reads CSV fields by number instead of by header, it can silently assign the wrong value to every field after username. A parser that has worked for months can keep running while producing bad reports.
What changed
GitHub says this applies to all GitHub Enterprise Cloud account types and standalone organizations on GitHub Team. It is not a new billing calculation. The report shape changes, while the usage amounts are calculated the same way.
The first fix: stop using column positions
Do not fix this by adding one to a hard-coded index. Read the header row, build a name-to-index map, or use a CSV library that returns each row as a dictionary. Header-based parsing survives inserted columns and makes the expected fields visible in code review.
import csv
with open("usage.csv", newline="") as file:
for row in csv.DictReader(file):
username = row.get("username")
user_id = row.get("user_id")
net_amount = row.get("net_amount")
# Store by user_id when it is present, not by username.Why user_id is better than username
Usernames are useful labels, but they are not stable identities. A person can rename an account, and a deleted account may no longer have a username in the report. user_id lets you keep the same account history together across a rename and identify usage that belongs to a deleted account.
The identifier also covers bot accounts. Do not assume that a missing or unfamiliar username means a human user. Store the account type or source fields your report provides, and keep bot usage separate when your cost model needs that distinction.
user_id can be empty. GitHub says it is empty when usage is not tied to an account. Keep that value as unknown or unassigned. Do not turn it into a fake user such as 0, system, or the empty string if those values could collide with real data.
Deleted accounts and totals
Usage from different deleted accounts will appear on separate rows instead of being combined into one empty-username row. GitHub also notes that totals you calculate may differ slightly in the last decimal places because each row is rounded separately. Compare totals with an appropriate tolerance rather than rejecting a report over a tiny rounding difference.
Do not mix report types
A short migration checklist
First, search for code that indexes report columns by number. Next, add a fixture containing username followed by user_id and assert that the fields land in the right database columns. Store user_id as a nullable string or integer according to the report contract. Then backfill account joins where username was previously the only key, and add a header check that fails loudly when a required field is missing.
If you match usage to audit events, use user_id as the durable join key and keep username as display data. If a row has no user_id, route it to an unassigned bucket and preserve the original row for later investigation.
Bottom line
The new user_id column fixes a real reporting weakness, but it can break brittle ingestion code on day one. Parse by header, key account history by user_id when present, preserve unknowns as unknown, and keep detailed, AI, premium request, and summarized reports on explicit schemas.
