使用to_sql()时无效的参数'fast_executemany'

我正在尝试使用fast_executemany加快to_sql()的速度。但是我遇到了错误,

TypeError:使用配置PGDialect_psycopg2 / QueuePool / Engine将无效的参数'fast_executemany'发送到create_engine()。请检查关键字参数是否适合此组件组合。

我一直在参考上一个问题Speeding up pandas.DataFrame.to_sql with fast_executemany of pyODBC

database_url = 'postgresql://{user}:{password}@{host}:5432/{database_name}'.format(
    user=user,host=host,password=password,database_name=database_name,)
engine = create_engine(database_url,echo=False,fast_executemany=True)
df.to_sql('parquet',con=engine,if_exists='replace')

如果我删除fast_executemany参数,则会执行此代码,但是会花费很长时间。我正在使用Python 3.7。

doctorzzr 回答:使用to_sql()时无效的参数'fast_executemany'

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3017079.html

大家都在问