Open chronitis opened 2 years ago
Hi, is there any better work around to this?
What I ended up doing is setting the credentials to default profile
/.aws/config
[default]
region = eu-west-2
output = table
aws_access_key_id = xxx
aws_secret_access_key = xxx
What I expected to happen:
With
aws_profile_name
in my DBT profile, all connections to AWS would use the specified SSO credentials (assuming I have the necessary permissions).What happened
Everything works fine for seeds, tests, materializing tables and views.
When trying to materialize an incremental, partitioned table in
insert_overwrite
mode, the task fails part way through with the errorUnable to locate credentials
. This appears to happen after the temporary table for incremental update has happened, but before it has been inserted into the original table.Cause
It looks like the profile is not used when making calls directly to Glue/S3 (rather than Athena). This happens in
clean_up_table
,clean_up_partitions
(which constructboto3.Client
directly), which expects to find static credentials in a config file or the environment.This can probably be fixed by constructing a
boto3.Session
with profile and passing that to bothpyathena
and using it to construct S3/Glue clients.I'll try and write a PR for this.