Skip to content

Commit

Permalink
fix: get_columns_in_relation for LAMBDA catalogs (dbt-labs#637)
Browse files Browse the repository at this point in the history
Co-authored-by: nicor88 <[email protected]>
  • Loading branch information
antonysouthworth-halter and nicor88 authored Apr 29, 2024
1 parent 7eb584c commit ac66fca
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions dbt/adapters/athena/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1081,10 +1081,15 @@ def get_columns_in_relation(self, relation: AthenaRelation) -> List[AthenaColumn
config=get_boto3_config(num_retries=creds.effective_num_retries),
)

get_table_kwargs = dict(
DatabaseName=relation.schema,
Name=relation.identifier,
)
if catalog_id:
get_table_kwargs["CatalogId"] = catalog_id

try:
table = glue_client.get_table(CatalogId=catalog_id, DatabaseName=relation.schema, Name=relation.identifier)[
"Table"
]
table = glue_client.get_table(**get_table_kwargs)["Table"]
except ClientError as e:
if e.response["Error"]["Code"] == "EntityNotFoundException":
LOGGER.debug("table not exist, catching the error")
Expand Down

0 comments on commit ac66fca

Please sign in to comment.