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

Function eval_where

hardness_eval.py:670–687  ·  view source on GitHub ↗
(pred, label)

Source from the content-addressed store, hash-verified

668
669
670def eval_where(pred, label):
671 pred_conds = [unit for unit in pred['where'][::2]]
672 label_conds = [unit for unit in label['where'][::2]]
673 label_wo_agg = [unit[2] for unit in label_conds]
674 pred_total = len(pred_conds)
675 label_total = len(label_conds)
676 cnt = 0
677 cnt_wo_agg = 0
678
679 for unit in pred_conds:
680 if unit in label_conds:
681 cnt += 1
682 label_conds.remove(unit)
683 if unit[2] in label_wo_agg:
684 cnt_wo_agg += 1
685 label_wo_agg.remove(unit[2])
686
687 return label_total, pred_total, cnt, cnt_wo_agg
688
689
690def eval_group(pred, label):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected