New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add engine_kwargs
argument to dask.dataframe.to_sql
#8596
Comments
@scharlottej13 I looked into this a bit and I think there are some design decisions to be made here.
If we were to expose Alternatively, to go back to the motivating issue, I think SSL configuration can be passed as the SQLAlchemy connection string (i.e. the already exposed p.s: first time dask contributor, let me know if I'm missing something here! |
Hi @amirkdv and welcome! Thanks for having a look at this issue. I think you bring up some great points about design consideration. Specifically:
This is exactly what I was thinking-- to make
Yes! That was exactly what we suggested as a solution. This issue is more of a feature request than a bug issue, in that sense. |
Thanks @scharlottej13! I hadn't look at the original Discourse page and had missed your comments re SSL, sorry about that! I've opened a PR for this. I used a simpler |
### Use case: SSL This was the original [use case] that motivated #8596: to force SSL on the db connection. Whether the new `engine_kwargs` argument is helpful/necessary for this use case depends on the db driver used by SQLAlchemy: * [MySQL] (helpful): either use `connect_args={'ssl': ...}` as engine kwarg or add `?ssl_cert=...&ssl_key=...` to URI. * [psycopg2] (not helpful): must use `?sslmode=require` in connection URI, not supported as engine argument. * [pg8000] (necessary): must use `connect_args={'ssl_context': ...}` as engine kwarg. [use case]: coiled/dask-community#186 [MySQL]: https://docs.sqlalchemy.org/en/14/dialects/mysql.html#ssl-connections [psycopg2]: https://docs.sqlalchemy.org/en/14/dialects/postgresql.html#ssl-connections [pg8000]: https://docs.sqlalchemy.org/en/14/dialects/postgresql.html#pg8000-ssl
This question came up on the Dask Discourse. We were able to come up with a solution, but noticed the
dask.dataframe.read_sql_table
accepts anengine_kwargs
argument whiledask.dataframe.to_sql
does not. Adding anengine_kwargs
argument would be a nice feature that would make usingto_sql
less confusing.The text was updated successfully, but these errors were encountered: