St_aggrid TreeData: Group nodes missing data in selected_rows - leaf nodes work fine

I’m experiencing a consistent issue with st_aggrid when using tree data structure. The problem is that selection works perfectly for leaf nodes (rows without children), but fails for group nodes
(parent rows that have children grouped under them).

Working vs Broken Behavior:

:white_check_mark: Leaf nodes (no children): Selection works perfectly, selected_rows contains all expected columns
:cross_mark: Group nodes (with children): Selection fails with KeyError, selected_rows missing columns

Error Details:
KeyError: “None of [Index([‘KEY’, ‘PARENT_KEY’, ‘LEVEL’, ‘ORDERING’, ‘AUTESTAT_TARGET’,
‘AUTESTAT_TOTAL_TESTS_NUMBER’, ‘AUTESTAT_AUTOMATED_TESTS_NUMBER’],
dtype=‘object’)] are in the [columns]”

Stack trace points to: AgGridReturn.py line 104 where st_aggrid tries to process numeric columns that don’t exist in group node selected_rows.

Use Case:
I need to filter data based on ANY row selection (both leaf and group nodes). When user clicks a parent row, I want to filter other sections by that parent’s data (KEY, LEVEL, APP_ID, etc.).

Configuration:
grid_options = {
“rowSelection”: {“mode”: “singleRow”, “enableClickSelection”: True},
“treeData”: True,
“getDataPath”: JsCode(“function(data) { return data.hierarchyPath; }”),
“getRowId”: JsCode(“function(data) { return data.KEY; }”),
“autoGroupColumnDef”: {
“headerName”: “Name”,
“field”: “NAME”,
“showRowGroup”: True,
}
}

DEMO CODE TO REPLICATE THIS ISSUE

Similar Experience:
I’ve encountered this pattern before where JavaScript click handlers added to group nodes don’t work while the same handlers on leaf nodes work perfectly. It seems like group nodes have different
internal structure.

Question:
Has anyone found a way to make group nodes return the same data structure as leaf nodes in selected_rows? Or a workaround to access parent node data for filtering purposes?

Thanks in advance :slight_smile: