MCPcopy Index your code
hub / github.com/dask/dask / test_to_sql_engine_kwargs

Function test_to_sql_engine_kwargs

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

Source from the content-addressed store, hash-verified

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…