Exemple #1
0
def test_complex_into(complex_csv, complex_sql):
    complex_sql, bind = complex_sql
    # data from: http://dummydata.me/generate
    into(complex_sql, complex_csv, dshape=discover(complex_sql), bind=bind)
    assert_allclose(
        into(list, complex_sql, bind=bind), into(list, complex_csv)
    )
def test_complex_into(tbl):
    # data from: http://dummydata.me/generate
    this_dir = os.path.dirname(__file__)
    file_name = os.path.join(this_dir, "dummydata.csv")

    ds = dshape(
        """
    var * {
        Name: string, RegistrationDate: date, ZipCode: int32, Consts: float64
    }"""
    )

    csv = CSV(file_name, has_header=True)
    sql = resource(url, tbl, dshape=ds)

    into(sql, csv)

    assert_allclose(into(list, sql), into(list, csv))