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

ENH: Implement option 'truncate' of argument if_exists in DataFrame.to_sql #59391

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

gmcrocetti
Copy link

@gmcrocetti gmcrocetti commented Aug 2, 2024

@@ -2373,6 +2399,14 @@ def to_sql(
cur.execute(f"DROP TABLE {table_name}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if we should use mode=replace instead of running a manual DROP TABLE statement. I can have other PR for this patch if it makes sense...

@gmcrocetti gmcrocetti marked this pull request as ready for review August 2, 2024 19:28
@gmcrocetti gmcrocetti changed the title Add 'truncate' in to_sql API feat: Implement option 'truncate' of argument if_exists in DataFrame.to_sql Aug 2, 2024
@gmcrocetti gmcrocetti force-pushed the issue-37210-to-sql-truncate branch 3 times, most recently from ad21c3b to eced22f Compare August 2, 2024 19:35
@gmcrocetti gmcrocetti marked this pull request as draft August 2, 2024 19:54
@gmcrocetti gmcrocetti marked this pull request as ready for review August 3, 2024 00:44
@gmcrocetti gmcrocetti changed the title feat: Implement option 'truncate' of argument if_exists in DataFrame.to_sql ENH: Implement option 'truncate' of argument if_exists in DataFrame.to_sql Aug 3, 2024
@gmcrocetti gmcrocetti force-pushed the issue-37210-to-sql-truncate branch 2 times, most recently from 4e93848 to e4b196a Compare August 3, 2024 13:27
@rhshadrach rhshadrach added Enhancement IO SQL to_sql, read_sql, read_sql_query labels Aug 4, 2024
@gmcrocetti
Copy link
Author

gmcrocetti commented Oct 11, 2024

Hi @erfannariman o/.
You were the only member of @pandas-dev to participate in the discussion of the issue - and that's why I @ you here :).
The PR is open for a while now and I just wanted to know if:

  1. there's still interest in this feature;
  2. Is there something I can do to help the reviewing process ?

Thanks in advance.

@erfannariman
Copy link
Member

Hi @erfannariman o/. You were the only member of @pandas-dev to participate in the discussion of the issue - and that's why I @ you here :). The PR is open for a while now and I just wanted to know if:

  1. there's still interest in this feature;
  2. Is there something I can do to help the reviewing process ?

Thanks in advance.

I reacted in the PR. Let's wait a couple days to see if we get some responses from others. If not, feel free to ping me again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement IO SQL to_sql, read_sql, read_sql_query
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENH: DataFrame.to_sql with if_exists='replace' should do truncate table instead of drop table
3 participants