Exemplo n.º 1
0
 def test_insert_into(self):
     # using copy
     iris = load_iris()
     result = insert_into(
         table_name="iris",
         schema="public",
         column_names=iris.get_columns(),
         data=iris.to_list(),
     )
     drop(name="public.iris", method="table")
     assert result == 150
     # using multiple inserts
     iris = load_iris()
     # generating the SQL code
     result = insert_into(
         table_name="iris",
         schema="public",
         column_names=iris.get_columns(),
         data=iris.to_list(),
         copy=False,
         genSQL=True,
     )
     assert len(result) == 150
     for elem in result:
         assert elem[0:27] == 'INSERT INTO "public"."iris"'
     # executing multiple inserts
     result = insert_into(
         table_name="iris",
         schema="public",
         column_names=iris.get_columns(),
         data=iris.to_list(),
         copy=False,
     )
     drop(name="public.iris", method="table")
     assert result == 150
Exemplo n.º 2
0
def iris_vd(base):
    from verticapy.datasets import load_iris

    iris = load_iris(cursor=base.cursor)
    yield iris
    with warnings.catch_warnings(record=True) as w:
        drop(name="public.iris", cursor=base.cursor)
def iris_vd(base):
    from verticapy.datasets import load_iris

    iris = load_iris(cursor=base.cursor)
    yield iris
    drop(
        name="public.iris",
        cursor=base.cursor,
    )
Exemplo n.º 4
0
def iris_vd():
    iris = load_iris()
    yield iris
    drop(name="public.iris", )