anumaurya114exp commited on
Commit
1680c83
·
1 Parent(s): 279b001

disable modifying wrong query.

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -81,7 +81,6 @@ def preProcessSQL(sql):
81
  disclaimerOutputStripping = """Results are stripped to show only top 5 rows.
82
  Please add your custom limit to get extend result.
83
  eg\n select * from schema.table limit 20\n\n"""
84
- sql = str(sql)
85
  sql = sqlparse.format(sql, reindent=True, keyword_case='upper')
86
  return sql, disclaimerOutputStripping
87
 
@@ -102,11 +101,11 @@ def testSQL(sql):
102
 
103
  print(f"Error occured during running the query {sql}.\n and the error is {str(e)}")
104
 
105
- prompt = f"Please correct the following sql query, also it has to be run on {PLATFORM}. sql query is \n {sql}. the error occured is {str(e)}."
106
- modifiedSql = queryHelper.modifySqlQueryEnteredByUser(prompt)
107
- logMessage = {"function":"queryHelper.modifySqlQueryEnteredByUser", "sqlQuery":sql, "modifiedSQLQuery":modifiedSql}
108
- saveLog(logMessage, 'info')
109
- return f"The query you entered throws some error. Here is modified version. Please try this.\n {modifiedSql}"
110
 
111
 
112
  def onSelectedTablesChange(tablesSelected):
 
81
  disclaimerOutputStripping = """Results are stripped to show only top 5 rows.
82
  Please add your custom limit to get extend result.
83
  eg\n select * from schema.table limit 20\n\n"""
 
84
  sql = sqlparse.format(sql, reindent=True, keyword_case='upper')
85
  return sql, disclaimerOutputStripping
86
 
 
101
 
102
  print(f"Error occured during running the query {sql}.\n and the error is {str(e)}")
103
 
104
+ # prompt = f"Please correct the following sql query, also it has to be run on {PLATFORM}. sql query is \n {sql}. the error occured is {str(e)}."
105
+ # modifiedSql = queryHelper.modifySqlQueryEnteredByUser(prompt)
106
+ # logMessage = {"function":"queryHelper.modifySqlQueryEnteredByUser", "sqlQuery":sql, "modifiedSQLQuery":modifiedSql}
107
+ # saveLog(logMessage, 'info')
108
+ return f"The query you entered throws some error. Here is the error.\n {str(e)}"
109
 
110
 
111
  def onSelectedTablesChange(tablesSelected):