Closed bwest2397 closed 2 years ago
I just wanted to post that we observed the same bug. As soon as there is a "." in the column name of a Pandas dataframe, the contents of that column are not shown in the resulting table.
Tested with Streamlit version: 1.2, 1.4 streamlit-aggrid version: 0.2.2.post4
P.S.: And thanks for that package, I love it to have AgGrid in Streamlit.
AgGrid documentation: https://www.ag-grid.com/javascript-data-grid/grid-properties/#reference-columns-suppressFieldDotNotation
suppressFieldDotNotation: If true, then dots in field names (e.g. address.firstline) are not treated as deep references. Allows you to use dots in your field name if you prefer.Default: false
So, you need to set this when your columns have dot's in their names. For convenience, I'm adding the following code to GridOptionsBuilder.from_dataframe() in V 0.2.3
if any('.' in col for col in dataframe.columns):
gb.configure_grid_options(suppressFieldDotNotation = True)
There's a bug that occurs when a period is present in the name of a column entered into AgGrid, all values in that column are displayed as empty. It can be visually worked around by replacing any periods in column names with the "one dot leader" character ("․", U+2024, or
"\u2024"
in Python), but that's an imperfect solution as the column names need to be restored in the returned dataframe.Demo code snippet:
Screenshots of the examples in the code snippet: