INNER CODE UNIT · Python
to_json
beader/tianchi_nl2sql · code/nl2sql/utils/__init__.py:109
def to_json(self):
return json.dumps(dict(self), ensure_ascii=False, sort_keys=True)
def equal_all_mode(self, other):
return self.to_json() == other.to_json()
def equal_agg_mode(self, other):
self_sql = SQL(cond_conn_op=0, agg=self.agg, sel=self.sel, conds=[])
other_sql = SQL(cond_conn_op=0, agg=other.agg, sel=other.sel, conds=[])
return self_sql.to_json() == other_sql.to_json()
def equal_conn_and_agg_mode(self, other):
self_sql = SQL(cond_conn_op=self.cond_conn_op,
agg=self.agg,
sel=self.sel,
conds=[])
other_sql = SQL(cond_conn_op=other.cond_conn_op,
agg=other.agg,