Skip to content

Commit

Permalink
fix: Replace login by user for clickhouse profile (#1255)
Browse files Browse the repository at this point in the history
## Description

The clickhouse profile is currently not working. Changing the login
parameter to user

## Related Issue(s)

closes #1249

## Breaking Change?

No

## Checklist

- [x] I have made corresponding changes to the documentation (if
required)
- [x] I have added tests that prove my fix is effective or that my
feature works
  • Loading branch information
petershenri authored Oct 16, 2024
1 parent e81b94f commit 9efeb1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cosmos/profiles/clickhouse/user_pass.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Maps Airflow Postgres connections using user + password authentication to dbt profiles."""
"""Maps Airflow Clickhouse connections using user + password authentication to dbt profiles."""

from __future__ import annotations

Expand All @@ -20,7 +20,7 @@ class ClickhouseUserPasswordProfileMapping(BaseProfileMapping):

required_fields = [
"host",
"login",
"user",
"schema",
"clickhouse",
]
Expand All @@ -29,7 +29,7 @@ class ClickhouseUserPasswordProfileMapping(BaseProfileMapping):
]
airflow_param_mapping = {
"host": "host",
"login": "login",
"user": "login",
"password": "password",
"port": "port",
"schema": "schema",
Expand Down
4 changes: 2 additions & 2 deletions tests/profiles/clickhouse/test_clickhouse_userpass.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def test_profile_args(mock_clickhouse_conn: Connection) -> None:
assert profile_mapping.profile == {
"type": "clickhouse",
"schema": mock_clickhouse_conn.schema,
"login": mock_clickhouse_conn.login,
"user": mock_clickhouse_conn.login,
"password": "{{ env_var('COSMOS_CONN_GENERIC_PASSWORD') }}",
"driver": "native",
"port": 9000,
Expand All @@ -102,7 +102,7 @@ def test_mock_profile() -> None:
assert profile_mapping.mock_profile == {
"type": "clickhouse",
"schema": "mock_value",
"login": "mock_value",
"user": "mock_value",
"driver": "native",
"port": 9000,
"host": "mock_value",
Expand Down

0 comments on commit 9efeb1c

Please sign in to comment.