Ejemplo n.º 1
0
def run(env: Environment, node: str = None, deps: bool = False):
    """Run snapflow pipeline"""
    if node:
        if deps:
            env.produce(node)
        else:
            env.run_node(node)
    else:
        raise NotImplementedError
        env.run_graph()
def test_example():
    env = Environment(metadata_storage="sqlite://")
    g = Graph(env)
    env.add_module(core)
    df = pd.DataFrame({"a": range(10), "b": range(10)})
    g.create_node(key="n1", pipe="extract_dataframe", config={"dataframe": df})
    output = env.produce("n1", g)
    assert_almost_equal(output.as_dataframe(), df)
Ejemplo n.º 3
0
def test_simple_import():
    dburl = get_tmp_sqlite_db_url()
    env = Environment(metadata_storage=dburl)
    g = Graph(env)
    env.add_module(core)
    df = pd.DataFrame({"a": range(10), "b": range(10)})
    g.create_node(key="n1", function="import_dataframe", params={"dataframe": df})
    blocks = env.produce("n1", g)
    assert_almost_equal(blocks[0].as_dataframe(), df, check_dtype=False)