is this any different from: https://github.com/dimagi/commcare-hq/blob/master/corehq/apps/reports/fields.py#L226?