I am trying to upload a large dask dataframe to a sql server but i'm getting an error and can't see anything wrong with the connection string. I am able to connect to the DB using this connection string but I get the error when running the following:
import sqlalchemy as sa
import dask.dataframe as dd
from dask.diagnostics import ProgressBar
pbar = ProgressBar()
pbar.register()
#windows authentication + fast_executemany=True
to_sql_uri = sa.create_engine('mssql+pyodbc://TEST-BI/DB_TEST?driver=SQL Server?Trusted_Connection=yes', fast_executemany=True)
ddf.to_sql('test', uri=to_sql_uri, if_exists='replace', index=False)
ValueError: Expected URI to be a string, got <class 'sqlalchemy.engine.base.Engine'>.
i've tried forcing the conversion of to_sql_uri to string but still get an error.