anumaurya114exp commited on
Commit
ce776f8
·
verified ·
1 Parent(s): bfda8a4

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +4 -2
utils.py CHANGED
@@ -213,7 +213,8 @@ def construct_with_stats(final_query, subquery_info):
213
 
214
  with_as_statements = []
215
  for subquery_name, subquery in subquery_info.items():
216
- with_as_statement = f"{subquery_name} AS (\n{subquery['result']}\n) \n--{subquery['description'].replace('\n',' ')}\n"
 
217
  with_as_statements.append(with_as_statement)
218
 
219
  with_as_statement = "\n,\n".join(with_as_statements)
@@ -234,7 +235,8 @@ def get_subquery_info(json_response):
234
 
235
  def add_single_query_description(query, json_response):
236
  if json_response.get("query",None)!=None:
237
- query = f"{query}\n --{json_response['query']['description'].replace('\n',' ')}\n"
 
238
  return query
239
 
240
  def construct_final_query(query, json_response):
 
213
 
214
  with_as_statements = []
215
  for subquery_name, subquery in subquery_info.items():
216
+ description = subquery['description'].replace('\n',' ')
217
+ with_as_statement = f"{subquery_name} AS (\n{subquery['result']}\n) \n--{description}\n"
218
  with_as_statements.append(with_as_statement)
219
 
220
  with_as_statement = "\n,\n".join(with_as_statements)
 
235
 
236
  def add_single_query_description(query, json_response):
237
  if json_response.get("query",None)!=None:
238
+ description = json_response['query']['description'].replace('\n',' ')
239
+ query = f"{query}\n --{description}\n"
240
  return query
241
 
242
  def construct_final_query(query, json_response):