Beispiel #1
0
def transform_source(job, dataset, source_name):
    """ Transform the contents of an uploaded source dataset to a
    well-understood file format. """
    source = Source(job.package, source_name)
    job.set_source(source)
    source = validate_table(source)
    if source.meta.get('num_failed') > 0:
        return job.failed()
    return source
Beispiel #2
0
def csvimport_table(name):
    from spendb.core import data_manager
    from spendb.etl.extract import validate_table, load_table

    package = data_manager.package(uuid.uuid4().hex)
    source = package.ingest(data_fixture(name))
    source = validate_table(source)
    rows = list(load_table(source))
    return source.meta.get('fields'), rows
Beispiel #3
0
def csvimport_table(name):
    from spendb.core import data_manager
    from spendb.etl.extract import validate_table, load_table

    package = data_manager.package(uuid.uuid4().hex)
    source = package.ingest(data_fixture(name))
    source = validate_table(source)
    rows = list(load_table(source))
    return source.meta.get('fields'), rows