def group_by(self, field=None, table=None, allow_duplicates=False):
        new_group_item = Group(
            field=field,
            table=table,
        )

        if allow_duplicates is False:
            for group_item in self.groups:
                if group_item.field.get_identifier() == new_group_item.field.get_identifier():
                    return self

        self.groups.append(new_group_item)

        return self
Adds a group by clause to the query by adding a ``Group`` instance to the query's
dataset/ETHPy150Open ambitioninc/django-query-builder/querybuilder/query.py/Query.group_by