Skip to content

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

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

Closed

Conversation

gmcrocetti
Copy link
Contributor

@gmcrocetti gmcrocetti commented Aug 2, 2024

@@ -2373,6 +2399,14 @@ def to_sql(
cur.execute(f"DROP TABLE {table_name}")
Copy link
Contributor 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 force-pushed the issue-37210-to-sql-truncate branch from d262bb4 to e8dee05 Compare August 2, 2024 19:10
@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 force-pushed the issue-37210-to-sql-truncate branch from eced22f to bd8c8ca Compare August 3, 2024 00:28
@gmcrocetti gmcrocetti marked this pull request as ready for review August 3, 2024 00:44
@gmcrocetti gmcrocetti force-pushed the issue-37210-to-sql-truncate branch from bd8c8ca to 29346ff Compare August 3, 2024 01:05
@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 gmcrocetti force-pushed the issue-37210-to-sql-truncate branch from e4b196a to bce011a Compare September 1, 2024 22:57
@gmcrocetti gmcrocetti force-pushed the issue-37210-to-sql-truncate branch from ce619c7 to bf9f21c Compare September 9, 2024 14:48
@gmcrocetti
Copy link
Contributor 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.

Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Nov 12, 2024
@gmcrocetti
Copy link
Contributor Author

The best option here is to close this PR. The community and the maintainers couldn't reach consensus over the feature in a timely manner - despite my efforts. I will be happy to work in this feature once we achieve that.

@gmcrocetti gmcrocetti closed this Nov 12, 2024
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 Stale
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