Describe the bug
I sometimes want to display a gr.Dataframe with no elements. But when I try to do that, I get this error:
Traceback (most recent call last):
File "E:\sd\venv\lib\site-packages\gradio\routes.py", line 337, in run_predict
output = await app.get_blocks().process_api(
File "E:\sd\venv\lib\site-packages\gradio\blocks.py", line 1018, in process_api
data = self.postprocess_data(fn_index, result["prediction"], state)
File "E:\sd\venv\lib\site-packages\gradio\blocks.py", line 956, in postprocess_data
prediction_value = block.postprocess(prediction_value)
File "E:\sd\venv\lib\site-packages\gradio\components.py", line 2629, in postprocess
if len(self.headers) < len(y[0]):
IndexError: list index out of range
As usual not terribly obvious what the actual error is but it turns out I can't have a gr.Dataframe with an empty list. Seems counterintuitive since a lot of gradio components can have an empty list as a value
Is there an existing issue for this?
Reproduction
- Create
gr.Dataframe
- Update the dataframe with value
[]
Screenshot
No response
Logs
System Info
gradio 3.16.2, Windows Server 2022, Google Chrome
Severity
serious, but I can work around it
Describe the bug
I sometimes want to display a
gr.Dataframewith no elements. But when I try to do that, I get this error:As usual not terribly obvious what the actual error is but it turns out I can't have a
gr.Dataframewith an empty list. Seems counterintuitive since a lot of gradio components can have an empty list as a valueIs there an existing issue for this?
Reproduction
gr.Dataframe[]Screenshot
No response
Logs
System Info
Severity
serious, but I can work around it