ClickHouse / ClickHouse/dbt-clickhouse

AWS Access key is not being fetched from env variables

Open
#243 8 comments 1 reaction 0 assignees View on GitHub
bug good first issue
Dominant language
Python
Stars
362
Forks
177
Avg merge
2d 10h
Merged PRs (30d)
8

Description

### Describe the bug

### Steps to reproduce
```yml
vars:
clickhouse_s3:
bucket: xx/xx
path: /**.parquet
fmt: Parquet
aws_access_key_id: "{{ env_var('AWS_ACCESS_KEY_ID') }}"
aws_secret_access_key: "{{ env_var('AWS_SECRET_ACCESS_KEY')}}"
```

or `select * from {{clickhouse_s3source('clickhouse_s3',aws_access_key_id='{{ env_var("AWS_ACCESS_KEY_ID") }}',aws_secret_access_key='{{ env_var("AWS_SECRET_ACCESS_KEY")}}')}}`

It wont pick up env var. If provided explicitly it works.

### Expected behaviour

Should work with variables

### Code examples, such as models or profile settings

### dbt and/or ClickHouse server logs

### Configuration
#### Environment
* dbt version:
* dbt-clickhouse version:
* clickhouse-driver version (if using native)
* clickhouse-connect version (if using http):
* Python version:
* Operating system:

#### ClickHouse server
* ClickHouse Server version:
* ClickHouse Server non-default settings, if any:
* `CREATE TABLE` statements for tables involved:
* Sample data for these tables, use [clickhouse-obfuscator](https://github.com/ClickHouse/ClickHouse/blob/master/programs/obfuscator/Obfuscator.cpp#L42-L80) if necessary

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the provided YAML variable and SQL examples, then trace how environment variables are handled in dbt-clickhouse. Confirm the fix by verifying that AWS credentials from AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY work without being passed explicitly.

Written by the indexing model from the issue text.

Assessment

Tech stack
clickhouse, python
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.