Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
save_table(..., mode="overwrite")
toStatementExecutionBackend
(#74). In this release, we've added support for overwriting a table when saving data using thesave_table
method in theStatementExecutionBackend
. Previously, attempting to use theoverwrite
mode would raise aNotImplementedError
. Now, when this mode is specified, the method first truncates the table before inserting the new rows. The truncation is done using theexecute
method to run aTRUNCATE TABLE
SQL command. Additionally, we've added a new integration test,test_overwrite
, to thetest_deployment.py
file to verify the newoverwrite
mode functionality. A new option,mode="overwrite"
, has been added to thesave_table
method, allowing for the existing data in the table to be deleted and replaced with the new data being written. We've also added two new test cases,test_statement_execution_backend_save_table_overwrite_empty_table
andtest_mock_backend_overwrite
, to verify the new functionality. It's important to note that the method signature has been updated to include a default value for themode
parameter, setting it toappend
by default. This change does not affect the functionality and only provides a more convenient default behavior for users of the method.