Check for groupedBy before flattening

- If we don't have a `group_by` value in the `data_source` we shouldn't attempt to regroup the data by this field.
- It looks like data comes out 'flat' if we don't have a `group_by` value.