AG Grid tree_data and get_data_path

After looking at the examples, I still seem not to be able to figure out how to return the get_data_path function properly to the component as I am a react noob.

According to the AG Grid docs It seems one must return a callback to return the path field.

Any hints would be much appreciated!

I tried a few different ways:

class State(rx.State):
    def get_data_path(self, row: dict) -> list[str]:
        print(row)
        return row["path"]

def report_grid(id, row_data, column_defs) -> rx.Component:
    return ag_grid(
        id=id,
        row_data=row_data,
        column_defs=column_defs,
        width="100%",
        tree_data=True,
        get_data_path=State.get_data_path,
    )

also tried get_data_path=lambda e0: e0["path"]

Thanks,

Oliver.