pc.data_table columns props aren't working with pd.DataFrame as a list of dictionaries
Describe the bug pc.data_table columns props aren't working with pd.DataFrame as a list of dictionaries
To Reproduce ` import pynecone as pc import pandas as pd
class State(pc.State): stbd=pd.DataFrame([ {'k1': 'v1', 'k2': 'v2', 'k3': 'v3'}, {'k1': 'v1', 'k2': 'v2', 'k3': 'v3'}, {'k1': 'v1', 'k2': 'v2', 'k3': 'v3'}]) def index(): return pc.data_table( data=State.stbd, columns=["k3", "k2"], pagination=True, search=True, ) app = pc.App(state=State) app.add_page(index,) app.compile() `
Expected behavior Fields mentioned in columns=["k3", "k2"] should be displayed in the same order.
Screenshots All the fields in the list of dictionaries are displayed.
** Specifics (please complete the following information):**
- Python Version: 3.8
- Pynecone Version: 0.1.16
- OS:
- Browser (Optional):
Additional context Add any other context about the problem here.
When I fetch data from MongoDB using pymongo I can restrict the fields by using projection, however, as the dictionary is an unordered data structure, "columns" in data_table would be helpful to display the fields in the required order.
I think this is a similar issue to #555 im looking into it right now
You dont need specify a column when the data is a pandas dataframe, The column values are automatically inferred.