def rename_group_slice(self, name, new_name):
        """Renames the group slice with the given name.

        Args:
            name: the group slice name
            new_name: the new group slice name
        """
        if self.media_type != fom.GROUP:
            raise ValueError("Dataset has no groups")

        if name not in self._doc.group_media_types:
            raise ValueError("Dataset has no group slice '%s'" % name)

        group_path = self.group_field + ".name"
        self.select_group_slices(name).set_field(group_path, new_name).save()

        # Reload these fields to be safer against concurrent edits. Because
        #   the default_group_slice could've been changed elsewhere so we need
        #   to know we have the latest values.
        self._doc.reload("group_media_types", "default_group_slice")

        # DON'T use pop()! https://github.com/voxel51/fiftyone/issues/4322
        new_media_type = self._doc.group_media_types[name]
        del self._doc.group_media_types[name]

        self._doc.group_media_types[new_name] = new_media_type

        if self._doc.default_group_slice == name:
            self._doc.default_group_slice = new_name

        if self.group_slice == name:
            self.group_slice = new_name

        self.save()
Renames the group slice with the given name.

        Args:
            name: the group slice name
            new_name: the new group slice name
        
fiftyone/core/dataset.py