-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUG] Autodetect AWS region during deltalake scan (#3104)
We do this already when we read from S3, but delta-rs does not, so their metadata reads fail. This is especially an issue for unity catalog tables, where the region is not specified anywhere. Tested locally, it works but I'm unsure how I would test this in unit tests since this is sort of unity+aws behavior specific Fix for #2903
- Loading branch information
1 parent
459ba82
commit 0727dc1
Showing
3 changed files
with
42 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from typing import TYPE_CHECKING | ||
|
||
from daft.daft import S3Config | ||
|
||
if TYPE_CHECKING: | ||
import boto3 | ||
|
||
|
||
def boto3_client_from_s3_config(service: str, s3_config: S3Config) -> "boto3.client": | ||
import boto3 | ||
|
||
return boto3.client( | ||
service, | ||
region_name=s3_config.region_name, | ||
use_ssl=s3_config.use_ssl, | ||
verify=s3_config.verify_ssl, | ||
endpoint_url=s3_config.endpoint_url, | ||
aws_access_key_id=s3_config.key_id, | ||
aws_secret_access_key=s3_config.access_key, | ||
aws_session_token=s3_config.session_token, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters