Closed bitadmiral closed 2 months ago
@guenp to take a look at this-- looks like it's related to the secrets
changes in https://github.com/duckdb/dbt-duckdb/pull/403
FWIW @bitadmiral if you can run on dbt-duckdb 1.8.1 for this, it should work using the legacy Glue registration code
Thank you @bitadmiral for the super thorough bug report and clear repro steps.
I think I've found the bug, I narrowed it down to this line, where we're not passing the credentials
to the plugin constructor: https://github.com/duckdb/dbt-duckdb/blob/master/dbt/adapters/duckdb/environments/local.py#L151
I'm attempting to write parquet files to S3 while also registering the output as a table in the Glue Catalog. My profile target looks like below where I define the secrets key.
My model configuration is configured as follows to create the table in Glue:
The SQL model is quite simple:
If I make one change to the model configuration,
glue_register: false
, then the model runs successfully. It reads the CSV file from S3 and writes the parquet file to S3.But with
glue_register: true
, I get this error:Running
dbt run --debug
shows this error is happening at line 348 in the initialize() function of the Plugin class in glue.py, in the call to_get_glue_client(config, secrets)
:I guess
self.creds
is not being set in the__init__
function of BasePlugin class, line 92 because the argumentcredentials: Optional[DuckDBCredentials] = None
isn't being passed, but I don't know why not.I have tried all of the following alternative target configurations and the result is the same error. However all of these will run the model successfully with
glue_register: false
.In each test case I verified that my credentials stored in the AWS... environment variables were still valid by running commands like
aws s3 ls ...
,aws s3api get-object --bucket <bucket_name> --key <object> <outfile>
. I'm just not sure what needs to be done in order to get the plugin to take the secret and pass it to the glue client.FYI, here is my current
pip list
:(I should also mention my issue is similar to issue #83 which was closed with a mystery solution.)
The environment in which I am running dbt is Ubuntu 22.04.4 LTS (Jammy Jellyfish) running in AWS Workspaces (essentially an EC2 instance).