Last active
September 12, 2019 19:58
-
-
Save 64lines/6bbc14bb0878c585719761b729998412 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from redshift_utils import Messages | |
from redshift_utils import ScriptReader | |
from redshift_utils import RedshiftDataManager | |
from settings import SCRIPT_PATH | |
from settings import DB_CONNECTION | |
def lambda_handler(event, context): | |
table_name = event.get('table_name') | |
new_table_name = event.get('new_table_name') | |
script = ScriptReader.get_script(SCRIPT_PATH).format(table_name, new_table_name) | |
return RedshiftDataManager.run_update(script, DB_CONNECTION) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment