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

deltalake _delta_lake.py: Allow Glue catalog cross account access #2113

Merged
merged 1 commit into from
Apr 15, 2024
Merged
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
9 changes: 8 additions & 1 deletion daft/io/_delta_lake.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,14 @@ def read_delta_lake(
aws_secret_access_key=s3_config.access_key,
aws_session_token=s3_config.session_token,
)
glue_table = glue.get_table(DatabaseName=table.database_name, Name=table.table_name)
if table.catalog_id is not None:
# Allow cross account access, table.catalog_id should be the target account id
glue_table = glue.get_table(
CatalogId=table.catalog_id, DatabaseName=table.database_name, Name=table.table_name
)
else:
glue_table = glue.get_table(DatabaseName=table.database_name, Name=table.table_name)

# TODO(Clark): Fetch more than just the table URI from Glue Data Catalog.
table_uri = glue_table["Table"]["StorageDescriptor"]["Location"]
elif table.catalog == DataCatalogType.UNITY:
Expand Down
Loading