aws-sdk-pandas
aws-sdk-pandas copied to clipboard
Provide option to skip commit in postgresql.to_sql to allow usage of transactions
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
Thanks, to be addressed in #2795