Skip to content
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

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

Closed
jaklan opened this issue May 19, 2021 · 1 comment · Fixed by #718
Closed

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

jaklan opened this issue May 19, 2021 · 1 comment · Fixed by #718
Assignees
Labels
enhancement New feature or request minor release Will be addressed in the next minor release ready to release
Milestone

Comments

@jaklan
Copy link

jaklan commented May 19, 2021

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.

@jaklan jaklan added the enhancement New feature or request label May 19, 2021
@jaidisido jaidisido self-assigned this May 25, 2021
@jaidisido
Copy link
Contributor

Thank you for raising this, the flag has been added. To test it:

pip uninstall awswrangler -y
pip install git+https://github.com/awslabs/aws-data-wrangler.git@main

until it's available in the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request minor release Will be addressed in the next minor release ready to release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants