MCPcopy Create free account
hub / github.com/dask/dask / test_to_sql_engine_kwargs

Function test_to_sql_engine_kwargs

dask/tests/test_distributed.py:821–841  ·  view source on GitHub ↗
(c, s, a, b)

Source from the content-addressed store, hash-verified

819)
820@gen_cluster(client=True)
821async def test_to_sql_engine_kwargs(c, s, a, b):
822 # https://github.com/dask/dask/issues/8738
823 pd = pytest.importorskip("pandas")
824 dd = pytest.importorskip("dask.dataframe")
825 pytest.importorskip("sqlalchemy")
826
827 df = pd.DataFrame({"a": range(10), "b": range(10)})
828 df.index.name = "index"
829 ddf = dd.from_pandas(df, npartitions=1)
830 with tmpfile() as f:
831 uri = f"sqlite:///{f}"
832 result = ddf.to_sql(
833 "test", uri, index=True, engine_kwargs={"echo": False}, compute=False
834 )
835 await c.compute(result)
836
837 dd.utils.assert_eq(
838 ddf,
839 dd.read_sql_table("test", uri, "index"),
840 check_divisions=False,
841 )
842
843
844@gen_cluster(client=True)

Callers

nothing calls this directly

Calls 3

tmpfileFunction · 0.90
to_sqlMethod · 0.80
computeMethod · 0.45

Tested by

no test coverage detected