Skip to content
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

fix: add 'CatalogId' Parameter to Glue Paginator Call (Related to PR #370) #467

Merged
merged 3 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions dbt/adapters/athena/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,14 @@ def clean_up_partitions(self, relation: AthenaRelation, where_condition: str) ->
conn = self.connections.get_thread_connection()
client = conn.handle

data_catalog = self._get_data_catalog(relation.database)
catalog_id = get_catalog_id(data_catalog)

with boto3_client_lock:
glue_client = client.session.client("glue", region_name=client.region_name, config=get_boto3_config())
paginator = glue_client.get_paginator("get_partitions")
partition_params = {
"CatalogId": catalog_id,
"DatabaseName": relation.schema,
"TableName": relation.identifier,
"Expression": where_condition,
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ def test_get_table_location_with_failure(self, dbt_debug_caplog, mock_aws_servic
@mock_glue
@mock_s3
@mock_athena
@mock_sts
def test_clean_up_partitions_will_work(self, dbt_debug_caplog, mock_aws_service):
table_name = "table"
mock_aws_service.create_data_catalog()
Expand Down