MCPcopy Create free account
hub / github.com/PaddlePaddle/Research / __init__

Method __init__

NLP/Text2SQL-BASELINE/text2sql/dataproc/sql_label.py:63–89  ·  view source on GitHub ↗

doc

(self, cond_conn_op: int, agg: list, sel: list, conds: list, **kwargs)

Source from the content-addressed store, hash-verified

61 dtype_num = 'real'
62
63 def __init__(self, cond_conn_op: int, agg: list, sel: list, conds: list, **kwargs):
64 """doc"""
65 self.cond_conn_op = cond_conn_op
66 self.sel = []
67 self.agg = []
68 sel_agg_pairs = sorted(zip(sel, agg), key=lambda x: x[0])
69 for col_id, agg_op in sel_agg_pairs:
70 self.sel.append(col_id)
71 self.agg.append(agg_op)
72 self.conds = list(sorted(conds, key=lambda x: x[0]))
73 self.order_by = list(sorted(kwargs.get("order_by", [])))
74 self.group_by = list(sorted(kwargs.get("group_by", [])))
75 self.having = list(sorted(kwargs.get("having", [])))
76 order_str = kwargs.get("order_direction", "").lower()
77 self.order_direction = self.order2id.get(order_str, 0)
78 limit = kwargs.get("limit", None)
79 self.limit = '0' if limit is None else str(limit)
80 self.sel_num = len(self.sel)
81 self.cond_num = len(self.conds)
82 self.group_num = len(self.group_by)
83 self.group_type = 0
84 if len(self.group_by) > 0:
85 self.group_type = 1
86 if len(self.having) > 0:
87 self.group_type = 2
88 elif len(self.order_by) > 0 and self.order_by[0][0] > 0:
89 self.group_type = 3
90
91
92 @classmethod

Callers

nothing calls this directly

Calls 2

appendMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected