aws-sdk-pandas icon indicating copy to clipboard operation
aws-sdk-pandas copied to clipboard

Provide option to skip commit in postgresql.to_sql to allow usage of transactions

Open Salatich opened this issue 1 year ago • 1 comments

Is your idea related to a problem? Please describe. Currently, if there are no exceptions when calling awswrangler.postgresql.to_sql then commit is automatically done:

https://github.com/aws/aws-sdk-pandas/blob/b13fcd8d169feb3219b4b4fff025dc6089cfe03b/awswrangler/postgresql.py#L359

It makes it impossible to use awswrangler.postgresql.to_sql as a part of a transaction which e.g. writes multiple tables, because if one of the transaction steps fails, you cannot rollback all the changes, just the last one.

Describe the solution you'd like To add extra parameter for awswrangler.postgresql.to_sql as it was done here, but for redshift: https://github.com/aws/aws-sdk-pandas/issues/705

Salatich avatar Apr 25 '24 19:04 Salatich

Thanks, to be addressed in #2795

jaidisido avatar May 01 '24 09:05 jaidisido