Skip to content

Commit

Permalink
Add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
svdimchenko committed Dec 16, 2024
1 parent 1947ebb commit 0f23cda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion dbt-athena/src/dbt/adapters/athena/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1178,10 +1178,12 @@ def delete_from_glue_catalog(self, relation: AthenaRelation) -> None:
raise e

@available
def drop_glue_database(self, database_name: str, catalog_id: Optional[str] = None) -> None:
def drop_glue_database(self, database_name: str, catalog_name: str = "awsdatacatalog") -> None:
conn = self.connections.get_thread_connection()
creds = conn.credentials
client = conn.handle
catalog = self._get_data_catalog(catalog_name)
catalog_id = get_catalog_id(catalog)

with boto3_client_lock:
glue_client: GlueClient = client.session.client(
Expand All @@ -1190,6 +1192,7 @@ def drop_glue_database(self, database_name: str, catalog_id: Optional[str] = Non
config=get_boto3_config(num_retries=creds.effective_num_retries),
)
glue_client.delete_database(Name=database_name, CatalogId=catalog_id)
LOGGER.info(f"Glue database successfully deleted: {catalog_name}.{database_name}")

@available.parse_none
def valid_snapshot_target(self, relation: BaseRelation) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
{% endmacro %}


{% macro drop_glue_database(database_name, catalog_id) -%}
{% macro drop_glue_database(database_name, catalog_id='awsdatacatalog') -%}
{{ adapter.drop_glue_database(database_name, catalog_id) }}
{% endmacro %}

0 comments on commit 0f23cda

Please sign in to comment.