Last active
August 30, 2018 20:03
-
-
Save jastang/717c3473a629b4f80b393c0321732951 to your computer and use it in GitHub Desktop.
Lambda function to update the Glue catalog
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
""" | |
First, start the crawler if it is not already running. | |
""" | |
crawler = glue.get_crawler(Name='%s-%s' % (client, DATA_FREQUENCY)) | |
if crawler['Crawler']['State'] == 'READY': | |
response = glue.start_crawler(Name='%s-%s' % (client, DATA_FREQUENCY)) | |
else: | |
print('Crawler is not in a READY state or already running! Checking the catalog instead.') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment