def _set_cols(
        self, data: TblData, boxhead: Boxhead, rowname_col: str | None, groupname_col: str | None
    ) -> tuple[Stub, Boxhead]:
        """Return a new Stub and Boxhead, with updated rowname and groupname columns.

        Note that None unsets a column.
        """

        new_boxhead = boxhead.set_stub_cols(rowname_col, groupname_col)
        new_stub = self.from_data(data, rowname_col, groupname_col)

        return new_stub, new_boxhead
Return a new Stub and Boxhead, with updated rowname and groupname columns.

        Note that None unsets a column.
        
great_tables/_gt_data.py