Update files from the datasets library (from 1.16.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.16.0
- wikisql.py +2 -4
wikisql.py
CHANGED
@@ -108,12 +108,10 @@ class WikiSQL(datasets.GeneratorBasedBuilder):
|
|
108 |
def _convert_to_human_readable(self, sel, agg, columns, conditions):
|
109 |
"""Make SQL query string. Based on https://github.com/salesforce/WikiSQL/blob/c2ed4f9b22db1cc2721805d53e6e76e07e2ccbdc/lib/query.py#L10"""
|
110 |
|
111 |
-
rep = "SELECT {agg} {sel} FROM table"
|
112 |
-
agg=_AGG_OPS[agg], sel=columns[sel] if columns is not None else "col{}".format(sel)
|
113 |
-
)
|
114 |
|
115 |
if conditions:
|
116 |
-
rep += " WHERE " + " AND ".join(["{
|
117 |
return " ".join(rep.split())
|
118 |
|
119 |
def _generate_examples(self, main_filepath, tables_filepath):
|
|
|
108 |
def _convert_to_human_readable(self, sel, agg, columns, conditions):
|
109 |
"""Make SQL query string. Based on https://github.com/salesforce/WikiSQL/blob/c2ed4f9b22db1cc2721805d53e6e76e07e2ccbdc/lib/query.py#L10"""
|
110 |
|
111 |
+
rep = f"SELECT {_AGG_OPS[agg]} {columns[sel] if columns is not None else f'col{sel}'} FROM table"
|
|
|
|
|
112 |
|
113 |
if conditions:
|
114 |
+
rep += " WHERE " + " AND ".join([f"{columns[i]} {_COND_OPS[o]} {v}" for i, o, v in conditions])
|
115 |
return " ".join(rep.split())
|
116 |
|
117 |
def _generate_examples(self, main_filepath, tables_filepath):
|