reflex icon indicating copy to clipboard operation
reflex copied to clipboard

Issue with pc.data_table on how it shows the output when column data is a list or tuple

Open sapanp007 opened this issue 3 years ago β€’ 2 comments

Describe the bug The issue with pc.data_table on how it shows the output when column data is a list or tuple. data=pd.DataFrame(data=[{"parentBuildID": 123, "childBuildID": ['1', '2', '3']}, {"parentBuildID": 234, "childBuildID": ['4', '5', '6']}]) Instead of showing childBuildID as ['1', '2', '3'] it shows 123

To Reproduce Steps to reproduce the behavior: Screenshot 2023-02-15 at 1 14 49 PM

    ```
    import pynecone as pc
    import pandas as pd
    class State(pc.State):
        data1=pd.DataFrame(data=[{"parentBuildID": "P1", "childBuildID": ['1', '2', '3']},
                                {"parentBuildID": "P2", "childBuildID": ['4', '5', '6']}])
        # data2=pd.DataFrame(data=[{"parentBuildID": "P1", "childBuildID": 123},
        #                         {"parentBuildID": "P2", "childBuildID": 456}])
        # Issue is that data_table doesn't show any difference between data variables data1 and data2 
    def index():
        return pc.data_table(
            data=State.data1,
            # data=State.data2,
            pagination=True,
            search=True,
        )
    app = pc.App(state=State)
    app.add_page(index)
    app.compile()
    ```

Expected behavior A clear and concise description of what you expected to happen. Colum data should be shown as it is. childBuildID as ['1', '2', '3'] instead of 123

Screenshots #541 - If the list of list support is fixed then a data frame would not be required but the issue should be addressed.

** Specifics (please complete the following information):**

  • Python Version:
  • Pynecone Version: 1.16
  • OS: Running on ubuntu's latest container on an Ubuntu 18.04 VM
  • Browser (Optional): Chrome

Additional context Add any other context about the problem here.

sapanp007 avatar Feb 15 '23 07:02 sapanp007

@sapanp007 If the column data is a list or tuple, I change it to str. https://github.com/pynecone-io/pynecone/pull/576

d29107d avatar Feb 21 '23 02:02 d29107d

https://github.com/pynecone-io/pynecone/pull/576 This issue can be closed.

d29107d avatar Mar 05 '23 04:03 d29107d

@Alek99 Could you close this issue, I have fixed it.

d29107d avatar Mar 16 '23 07:03 d29107d