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:822–842  ·  view source on GitHub ↗
(c, s, a, b)

Source from the content-addressed store, hash-verified

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