93c52d01c28404f1899b3f33cfccc84af8dd73d9,tests/test_bql.py,,test_createtab,#,1378

Before Change


        // Make sure ignore columns work.
        //
        // XXX Also check key columns.
        bdb.execute("""
            create generator t_cc0 for t using crosscat (
                guess(*),
                age ignore
            )
        """)
        bdb.execute("drop generator t_cc0")
        generator_id = core.bayesdb_get_generator(bdb, "t_cc")
        colno = core.bayesdb_generator_column_number(bdb, generator_id, "age")
        assert core.bayesdb_generator_column_stattype(bdb, generator_id,

After Change


            bdb.execute("drop table t")
        bdb.execute("drop table if exists t")
        with pytest.raises(apsw.SQLError):
            bdb.execute("drop population p")
        bdb.execute("drop population if exists p")
        with pytest.raises(bayeslite.BQLError):
            bdb.execute("drop generator p_cc")
        bdb.execute("drop generator if exists p_cc")
        with open(fname, "rU") as f:
            bayeslite.bayesdb_read_csv(bdb, "t", f, header=True, create=True)
        with bdb.savepoint():
            // Savepoint because we don"t actually want the new data to
            // be inserted.
            with open(fname, "rU") as f:
                bayeslite.bayesdb_read_csv(bdb, "t", f, header=True,
                    create=True, ifnotexists=True)
        bdb.execute("""
            create population p for t (
                guess(*),
                age numerical
            )
        """)
        bdb.execute("create generator t_cc for t using crosscat ()")
        with pytest.raises(bayeslite.BQLError):
            // Redefining population.
            bdb.execute("""
                create population p for t (
                    guess(*),
                    age ignore
                )
            """)
        with pytest.raises(bayeslite.BQLError):
            // Redefining generator.
            bdb.execute("create generator p_cc for p using crosscat")
        // Make sure ignore columns work.
        //
        // XXX Also check key columns.
        bdb.execute("""
            create population p0 for t (
                guess(*),
                age ignore
            )
        """)
        bdb.execute("drop population p0")
        population_id = core.bayesdb_get_population(bdb, "p")
        colno = core.bayesdb_variable_number(bdb, population_id, "age")
        assert core.bayesdb_variable_stattype(bdb, population_id, colno) == \
            "numerical"
        bdb.execute("initialize 1 model for p_cc")
        with pytest.raises(bayeslite.BQLError):
            bdb.execute("drop table t")
        with pytest.raises(bayeslite.BQLError):
            bdb.execute("drop population p")
        bdb.execute("drop generator p_cc")
        with pytest.raises(bayeslite.BQLError):
            bdb.execute("drop generator p_cc")
        with pytest.raises(bayeslite.BQLError):
            bdb.execute("drop table t")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: probcomp/bayeslite
Commit Name: 93c52d01c28404f1899b3f33cfccc84af8dd73d9
Time: 2016-06-27
Author: riastradh+probcomp@csail.mit.edu
File Name: tests/test_bql.py
Class Name:
Method Name: test_createtab


Project Name: probcomp/bayeslite
Commit Name: 93c52d01c28404f1899b3f33cfccc84af8dd73d9
Time: 2016-06-27
Author: riastradh+probcomp@csail.mit.edu
File Name: tests/test_bql.py
Class Name:
Method Name: test_createtab


Project Name: probcomp/bayeslite
Commit Name: 844b4e200dad7cd86af524d2dca71739d334bab7
Time: 2016-06-28
Author: riastradh+probcomp@csail.mit.edu
File Name: tests/test_subsample.py
Class Name:
Method Name: test_subsample


Project Name: graphbrain/graphbrain
Commit Name: 508df98357daa14046de21963b5a649106f6d47b
Time: 2011-08-15
Author: telmo@telmomenezes.net
File Name: gb/createdb.py
Class Name:
Method Name:


Project Name: probcomp/bayeslite
Commit Name: 93c52d01c28404f1899b3f33cfccc84af8dd73d9
Time: 2016-06-27
Author: riastradh+probcomp@csail.mit.edu
File Name: tests/test_bql.py
Class Name:
Method Name: test_trivial_commands