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

Function execute_sql

evaluation/src/evaluation.py:19–30  ·  view source on GitHub ↗
(predicted_sql, ground_truth, db_path)

Source from the content-addressed store, hash-verified

17
18
19def execute_sql(predicted_sql, ground_truth, db_path):
20 conn = sqlite3.connect(db_path)
21 # Connect to the database
22 cursor = conn.cursor()
23 cursor.execute(predicted_sql)
24 predicted_res = cursor.fetchall()
25 cursor.execute(ground_truth)
26 ground_truth_res = cursor.fetchall()
27 res = 0
28 if set(predicted_res) == set(ground_truth_res):
29 res = 1
30 return res
31
32
33def execute_model(predicted_sql, ground_truth, db_place, idx, meta_time_out):

Callers

nothing calls this directly

Calls 1

executeMethod · 0.45

Tested by

no test coverage detected