St.aggrid did not give right group by tree result

I acquired the code provided below from the following link: Interactive Table in Streamlit with AgGrid. While the code operates as intended for grouping or generating a group-by tree on that website, it does not execute correctly in my local Python environment within VSCode. Although the data is displayed, the group-by function does not work, nor does it present the group-by tree based on the selections made via checkboxes. I would appreciate it if you could provide the correct code and guide me on how to achieve a group-by tree with summation. Thank you in advance for your assistance.

see my code

import streamlit as st
import pandas as pd
from st_aggrid import AgGrid
from st_aggrid import AgGrid, GridOptionsBuilder
from st_aggrid import AgGrid, GridOptionsBuilder, JsCode

Load sample dataset

#df = pd.read_json(“https://www.ag-grid.com/example-assets/olympic-winners.json”)
#df = pd.read_excel(“C:/mfa/mfa1.xlsx”)

groupby = st.checkbox(“Group by country and age”, False)
gridOptions = {
‘rowSelection’: “multiple”,
‘groupSelectsChildren’: True,
‘autoGroupColumnDef’: {
‘headerName’: ‘My Group’,
‘minWidth’: 220,
‘cellRendererParams’: {
‘suppressCount’: False,
‘checkbox’: True,
}
},
‘columnDefs’: [
{ ‘field’: “athlete”, ‘minWidth’: 150,},
# First group by by country
{ ‘field’: “country”, ‘minWidth’: 150, ‘rowGroup’: groupby, ‘hide’: groupby},
# Second group by by age
{ ‘field’: “age”, ‘maxWidth’: 90, ‘rowGroup’: groupby, ‘hide’: groupby},
{ ‘field’: “year”, ‘maxWidth’: 90 },
{ ‘field’: “date”, ‘minWidth’: 150 },
{ ‘field’: “sport”, ‘minWidth’: 150 },
{ ‘field’: “gold” },
{ ‘field’: “silver” },
{ ‘field’: “bronze” },
{ ‘field’: “total” },
],
‘defaultColDef’: {
‘flex’: 1,
‘minWidth’: 100,
},
};

tabs = st.tabs([‘Grid’, ‘GridOptions’, ‘AgGridReturn.selected_data’])

with tabs[0]:
response = AgGrid(df, gridOptions, key=‘grid1’)
with tabs[1]:
st.write("testing ")
with tabs[2]:
st.write("testing ")
#selected_data = response.selected_data

#if selected_data is None:

st.write(‘Nothing was selected!’)

#else:

st.write(response.selected_data)