Python SDK bulk user creation from CSV failing on department_id

Trying to script bulk user creation via the Python SDK. The docs state: “The department_id is optional but recommended.” I’m parsing a CSV and iterating through the rows.

user = PlatformUser(username=row['username'], department_id=row['dept_id'])
client.users.post_user(body=user)

Getting a 400 BAD_REQUEST. The dept_id in the CSV is definitely valid. Why is the SDK rejecting it?