| 822 | ) |
| 823 | @gen_cluster(client=True) |
| 824 | async 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) |