Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui.aggrid.from_pandas not display any data when dataframe contains non-string column name #1665

Closed
CrystalWindSnake opened this issue Sep 22, 2023 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@CrystalWindSnake
Copy link
Contributor

Description

from nicegui import ui
import pandas as pd

df = pd.DataFrame({1: list("abc"), "num": range(3)})
ui.aggrid.from_pandas(df)

It seems that when defining columnDefs, convert col to str can solve the problem.

source code

@falkoschindler
Copy link
Contributor

Thanks for spotting this, @CrystalWindSnake!
I'm not sure how common this case is and if str(col) introduces any new problems. But if we expect col to be a string, wrapping it with str shouldn't do any harm. And this way your example works indeed. 👍

@falkoschindler falkoschindler added the enhancement New feature or request label Sep 25, 2023
@falkoschindler falkoschindler added this to the 1.3.15 milestone Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants