MCPcopy Create free account
hub / github.com/FlyingFeather/DEA-SQL / reformat_query

Function reformat_query

evaluation/test-suite-sql-eval/parse.py:83–89  ·  view source on GitHub ↗
(query: str)

Source from the content-addressed store, hash-verified

81
82
83def reformat_query(query: str) -> str:
84 query = query.strip().replace(";", "").replace("\t", "")
85 query = ' '.join([t.value for t in tokenize(query) if t.ttype != sqlparse.tokens.Whitespace])
86 t_stars = ["t1.*", "t2.*", "t3.*", "T1.*", "T2.*", "T3.*"]
87 for ts in t_stars:
88 query = query.replace(ts, "*")
89 return query
90
91
92def replace_values(sql: str) -> Tuple[List[str], Set[str]]:

Callers 1

extract_query_valuesFunction · 0.85

Calls 1

tokenizeFunction · 0.70

Tested by

no test coverage detected