Skip to content

Commit bce9dc3

Browse files
authored
Merge pull request #37 from pulsar256/bugfix/fix_sqlalchemy_url_quoting
Fix authentication errors for passwords with special characters
2 parents 52baf8d + 8bf0929 commit bce9dc3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tap_clickhouse/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from __future__ import annotations
77

88
from typing import Any, Iterable
9+
from urllib.parse import quote
910

1011
import sqlalchemy # noqa: TCH002
1112
from singer_sdk import SQLConnector, SQLStream
@@ -37,7 +38,7 @@ def get_sqlalchemy_url(self, config: dict) -> str:
3738
else:
3839
secure_options = f"secure={config['secure']}&verify={config['verify']}"
3940
return (
40-
f"clickhouse+{config['driver']}://{config['username']}:{config['password']}@"
41+
f"clickhouse+{config['driver']}://{quote(config['username'])}:{quote(config['password'])}@"
4142
f"{config['host']}:{config['port']}/"
4243
f"{config['database']}?{secure_options}"
4344
)

0 commit comments

Comments
 (0)