Skip to content

Provide option to skip commit in redshift.to_sql to allow usage of transactions #705

@jaklan

Description

@jaklan

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 keeping True as default: commit: bool = True.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions