Provide option to skip commit in redshift.to_sql to allow usage of transactions #705
Labels
enhancement
New feature or request
minor release
Will be addressed in the next minor release
ready to release
Milestone
Is your idea related to a problem? Please describe.
Currently, if there are no exceptions when calling
awswrangler.redshift.to_sql
then commit is automatically done:https://github.com/awslabs/aws-data-wrangler/blob/b13fcd8d169feb3219b4b4fff025dc6089cfe03b/awswrangler/redshift.py#L832
It makes it impossible to use
awswrangler.redshift.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
Additional parameter for
awswrangler.redshift.to_sql
to disable final commit, but keepingTrue
as default:commit: bool = True
.The text was updated successfully, but these errors were encountered: