Skip to content
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

FEAT: Allow custom engine options in to_sql using ModinDatabaseConnection #5626

Open
bensolom opened this issue Feb 6, 2023 · 2 comments
Open
Labels
External Pull requests and issues from people who do not regularly contribute to modin new feature/request 💬 Requests and pull requests for new features P1 Important tasks that we should complete soon

Comments

@bensolom
Copy link

bensolom commented Feb 6, 2023

Hi
I was wondered if is it possible to init the pyODBC engine with fast_executemany flag and pass it to modin.to_sql function.
It has great performance in pandas, ex:

engine_obj = create_engine(engine_str, fast_executemany=True)
pandas_df.to_sql(name="table", con=engine_obj)

Thank you
Ben

@bensolom bensolom added question ❓ Questions about Modin Triage 🩹 Issues that need triage labels Feb 6, 2023
@mvashishtha mvashishtha added new feature/request 💬 Requests and pull requests for new features P1 Important tasks that we should complete soon and removed question ❓ Questions about Modin Triage 🩹 Issues that need triage labels Feb 6, 2023
@mvashishtha mvashishtha changed the title Use fast_executemany flag FEAT: Allow custom engine options in to_sql using ModinDatabaseConnection Feb 6, 2023
@mvashishtha
Copy link
Collaborator

mvashishtha commented Feb 6, 2023

@bensolom thank you for the suggestion; this need has come up in different forms before. Currently, we require that users pass in a connection string to to_sql because we can't pickle a connection object (see #4048). However, users often need to make each connection with some extra parameters, e.g. fast_executemany here (as it happens, I have seen the need for this exact parameter before).

the solution is to copy our solution for read_sql: users can pass in a pickleable ModinDatabaseConnection object that describes how to make each connection for the write. I actually implemented this feature in commits on top of modin 0.8.3, (in particular see this one) but we have yet to merge this feature into Modin.

Unfortunately I can't get to this right now. Contributions are welcome. cc @modin-project/modin-contributors @modin-project/modin-core

@bensolom
Copy link
Author

bensolom commented Feb 7, 2023

@bensolom thank you for the suggestion; this need has come up in different forms before. Currently, we require that users pass in a connection string to to_sql because we can't pickle a connection object (see #4048). However, users often need to make each connection with some extra parameters, e.g. fast_executemany here (as it happens, I have seen the need for this exact parameter before).

the solution is to copy our solution for read_sql: users can pass in a pickleable ModinDatabaseConnection object that describes how to make each connection for the write. I actually implemented this feature in commits on top of modin 0.8.3, (in particular see this one) but we have yet to merge this feature into Modin.

Unfortunately I can't get to this right now. Contributions are welcome. cc @modin-project/modin-contributors @modin-project/modin-core

Thank you @mvashishtha

@anmyachev anmyachev added the External Pull requests and issues from people who do not regularly contribute to modin label Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External Pull requests and issues from people who do not regularly contribute to modin new feature/request 💬 Requests and pull requests for new features P1 Important tasks that we should complete soon
Projects
None yet
Development

No branches or pull requests

3 participants