0ae9073fb7b144b8d5793f395f2e3240581eb999,src/compiler.py,BQLCompiler_1Row_Infer,compile_bql,#BQLCompiler_1Row_Infer#Any#Any#Any#,915
Before Change
colno = core.bayesdb_variable_number(bdb, population_id,
bql.column)
out.write("bql_predict(%d, " % (population_id,))
compile_expression(bdb, self.modelno, self, out)
out.write(", %d, %s, " % (colno, rowid_col))
compile_expression(bdb, bql.confidence, self, out)
out.write(")")
elif isinstance(bql, ast.ExpBQLPredictConf):
assert bql.column is not None
colno = core.bayesdb_variable_number(bdb, population_id,
bql.column)
out.write("bql_predict_confidence(%d, " % (population_id,))
compile_expression(bdb, self.modelno, self, out)
out.write(", %d, %s)" % (colno, rowid_col))
else:
super(BQLCompiler_1Row_Infer, self).compile_bql(bdb, bql, out)
After Change
def compile_bql(self, bdb, bql, out):
assert ast.is_bql(bql)
population_id = self.population_id
generator_id = self.generator_id
rowid_col = "_rowid_" // XXX Don"t hard-code this.
if isinstance(bql, ast.ExpBQLPredict):
assert bql.column is not None
if not core.bayesdb_has_variable(bdb, population_id, bql.column):
population = core.bayesdb_population_name(bdb, population_id)
raise BQLError(bdb, "No such column in population %s: %s" %
(population, bql.column))
colno = core.bayesdb_variable_number(bdb, population_id,
bql.column)
out.write("bql_predict(%d, %s" %
(population_id, nullor(generator_id)))
out.write(", %d, %s, " % (colno, rowid_col))
compile_expression(bdb, bql.confidence, self, out)
out.write(")")
elif isinstance(bql, ast.ExpBQLPredictConf):
assert bql.column is not None
colno = core.bayesdb_variable_number(bdb, population_id,
bql.column)
out.write("bql_predict_confidence(%d, %s" %
(population_id, nullor(generator_id)))
out.write(", %d, %s)" % (colno, rowid_col))
else:
super(BQLCompiler_1Row_Infer, self).compile_bql(bdb, bql, out)
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 6
Instances
Project Name: probcomp/bayeslite
Commit Name: 0ae9073fb7b144b8d5793f395f2e3240581eb999
Time: 2016-06-29
Author: riastradh+probcomp@csail.mit.edu
File Name: src/compiler.py
Class Name: BQLCompiler_1Row_Infer
Method Name: compile_bql
Project Name: probcomp/bayeslite
Commit Name: 0ae9073fb7b144b8d5793f395f2e3240581eb999
Time: 2016-06-29
Author: riastradh+probcomp@csail.mit.edu
File Name: src/compiler.py
Class Name: BQLCompiler_1Row_Infer
Method Name: compile_bql
Project Name: probcomp/bayeslite
Commit Name: 0ae9073fb7b144b8d5793f395f2e3240581eb999
Time: 2016-06-29
Author: riastradh+probcomp@csail.mit.edu
File Name: src/compiler.py
Class Name: BQLCompiler_1Row
Method Name: compile_bql
Project Name: probcomp/bayeslite
Commit Name: 0ae9073fb7b144b8d5793f395f2e3240581eb999
Time: 2016-06-29
Author: riastradh+probcomp@csail.mit.edu
File Name: src/compiler.py
Class Name: BQLCompiler_1Col
Method Name: compile_bql
Project Name: probcomp/bayeslite
Commit Name: 0ae9073fb7b144b8d5793f395f2e3240581eb999
Time: 2016-06-29
Author: riastradh+probcomp@csail.mit.edu
File Name: src/compiler.py
Class Name: BQLCompiler_2Row
Method Name: compile_bql