def add_group_field(
        self,
        field_name,
        default=None,
        description=None,
        info=None,
        read_only=False,
    ):
        """Adds a group field to the dataset, if necessary.

        Args:
            field_name: the field name
            default (None): a default group slice for the field
            description (None): an optional description
            info (None): an optional info dict
            read_only (False): whether the field should be read-only

        Raises:
            ValueError: if a group field with another name already exists
        """
        expanded = self._add_group_field(
            field_name,
            default=default,
            description=description,
            info=info,
            read_only=read_only,
        )

        if expanded:
            self._reload()
Adds a group field to the dataset, if necessary.

        Args:
            field_name: the field name
            default (None): a default group slice for the field
            description (None): an optional description
            info (None): an optional info dict
            read_only (False): whether the field should be read-only

        Raises:
            ValueError: if a group field with another name already exists
        
fiftyone/core/dataset.py