Skip to content

Instantly share code, notes, and snippets.

@jastang
Last active August 30, 2018 20:03
Show Gist options
  • Save jastang/717c3473a629b4f80b393c0321732951 to your computer and use it in GitHub Desktop.
Save jastang/717c3473a629b4f80b393c0321732951 to your computer and use it in GitHub Desktop.
Lambda function to update the Glue catalog
"""
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