jk200201 commited on
Commit
a3e75c0
·
verified ·
1 Parent(s): ebfc4ea

Fix Browse dropdown: allow_custom_value for dynamically-populated choices

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -345,7 +345,11 @@ with gr.Blocks(title="LocalSQL") as demo:
345
  schema_map = gr.HTML()
346
 
347
  with gr.Accordion("Browse data (peek at rows)", open=False):
348
- table_dropdown = gr.Dropdown(label="Table", choices=[], interactive=True)
 
 
 
 
349
  browse_df = gr.Dataframe(label="First 10 rows", interactive=False)
350
 
351
  with gr.Row():
 
345
  schema_map = gr.HTML()
346
 
347
  with gr.Accordion("Browse data (peek at rows)", open=False):
348
+ # allow_custom_value: choices are populated dynamically by refresh_browser,
349
+ # so the backend must not reject a value it has not registered yet.
350
+ table_dropdown = gr.Dropdown(
351
+ label="Table", choices=[], interactive=True, allow_custom_value=True
352
+ )
353
  browse_df = gr.Dataframe(label="First 10 rows", interactive=False)
354
 
355
  with gr.Row():