-
Notifications
You must be signed in to change notification settings - Fork 722
Add exist_ok flag to create_database #645
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
Add exist_ok flag to create_database #645
Conversation
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
jaidisido
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, left a couple of suggestions
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
| if description is not None: | ||
| args["Description"] = description | ||
|
|
||
| if catalog_id is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this conditional removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By using https://github.com/awslabs/aws-data-wrangler/blob/main/awswrangler/catalog/_utils.py#L17 in the create_database call, the catalog id is used for the creation if it is given but not used otherwise. Thereby the check is not required but included directly in the create call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I figured so but wanted to double check with you. Thanks @maxispeicher :)
Issue #642:
Description of changes:
Before trying to create a new glue database,
awswranglernow checks if the database already exists. Ifexist_okis set toFalseand a database with the same name exists, an Exception is raised. Ifexist_okis set toTrueand the given description is different than the existing one it is updated.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.