anumaurya114exp commited on
Commit
12c6ec6
·
1 Parent(s): bb46958
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -114,7 +114,7 @@ eg\n select * from schema.table limit 20\n\n"""
114
  sql = sqlparse.format(sql, reindent=True, keyword_case='upper')
115
  return sql, disclaimerOutputStripping
116
 
117
- def getResultFilePath():
118
  global dbEngine, queryHelper
119
  sql, disclaimerOutputStripping = preProcessSQL(sql=sql)
120
  if not isDataQuery(sql):
@@ -265,7 +265,7 @@ with gr.Blocks() as demo:
265
 
266
  csvFileComponent = gr.File([], file_count='multiple')
267
  downloadCsv = gr.Button("Get result as csv")
268
- downloadCsv.click(getResultFilePath, inputs=text_input, outputs=csvFileComponent)
269
 
270
  # screen 3 : To set creds, schema, tables and columns
271
  with gr.Tab("Setup"):
 
114
  sql = sqlparse.format(sql, reindent=True, keyword_case='upper')
115
  return sql, disclaimerOutputStripping
116
 
117
+ def onGetResultCsvFile(sql):
118
  global dbEngine, queryHelper
119
  sql, disclaimerOutputStripping = preProcessSQL(sql=sql)
120
  if not isDataQuery(sql):
 
265
 
266
  csvFileComponent = gr.File([], file_count='multiple')
267
  downloadCsv = gr.Button("Get result as csv")
268
+ downloadCsv.click(onGetResultCsvFile, inputs=text_input, outputs=csvFileComponent)
269
 
270
  # screen 3 : To set creds, schema, tables and columns
271
  with gr.Tab("Setup"):