-
Notifications
You must be signed in to change notification settings - Fork 53
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When there's no data in the grid, the data getter produces an error.
To Reproduce
Steps to reproduce the behavior:
- Import DataGrid and pandas
from ipydatagrid import DataGrid
import pandas as pd
- Create simple dataframe and input into DataGrid
df = pd.DataFrame([1], columns=["a"])
grid = DataGrid(df)
grid
We can also call the data getter:
grid.data
- Now drop all the rows in the dataframe and set using the data setter.
grid.data = grid.data.drop(0)
We see that the DataGrid UI object reflects those changes (we only have the columns):
- Now call the data getter:
grid.data
- See error
Expected behavior
I expect an empty dataframe to be returned like this when calling the data getter:
Environment (please complete the following information):
- Operating System and Version: Ubuntu 20.04 WSL
- Browser [e.g. Firefox, Safari] (if applicable): Chrome (Using Jupyter Lab)
Any help with this is much appreciated. Cheers!
florenzi002
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working