Since we know that rr['type'] has a value (i.e., 'survey_summary'), and we've just assigned that value into a key on report, we know that this test (if report) will always pass. Why have the test at all?

Or should that type assignment get moved to (diff) line 150 or so, inside the if?