Skip to content

Conversation

@maxispeicher
Copy link
Contributor

Issue #642:

Description of changes:
Before trying to create a new glue database, awswrangler now checks if the database already exists. If exist_ok is set to False and a database with the same name exists, an Exception is raised. If exist_ok is set to True and 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.

@jaidisido
Copy link
Contributor

AWS CodeBuild CI Report

  • CodeBuild project: GitHubCodeBuild8756EF16-sDRE8Pq0duHT
  • Commit ID: d6d3b7a
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

@jaidisido jaidisido left a 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

@jaidisido jaidisido added enhancement New feature or request minor release Will be addressed in the next minor release labels Apr 12, 2021
@jaidisido jaidisido added this to the 2.7.0 milestone Apr 12, 2021
@maxispeicher maxispeicher requested a review from jaidisido April 12, 2021 16:21
@jaidisido
Copy link
Contributor

AWS CodeBuild CI Report

  • CodeBuild project: GitHubCodeBuild8756EF16-sDRE8Pq0duHT
  • Commit ID: e09373e
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@jaidisido jaidisido merged commit 1801ff6 into aws:main Apr 12, 2021
@jaidisido jaidisido linked an issue Apr 12, 2021 that may be closed by this pull request
@maxispeicher maxispeicher deleted the add_exist_flag_to_catalog_create branch April 12, 2021 16:57
if description is not None:
args["Description"] = description

if catalog_id is not None:
Copy link

@bschaatsbergen bschaatsbergen May 4, 2022

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?

Copy link
Contributor Author

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.

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request minor release Will be addressed in the next minor release ready to release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhance catalog.create_database with exist_ok option

3 participants