Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix authentication errors for passwords with special characters #227

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: quote username and password for sqlalchemy url
  • Loading branch information
pulsar256 committed Dec 5, 2024
commit 74e37f9fccd54fbfc64fe0f403b3709551d68fa3
3 changes: 2 additions & 1 deletion target_clickhouse/connectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import contextlib
import typing
from typing import TYPE_CHECKING
from urllib.parse import quote

import sqlalchemy.types
from clickhouse_sqlalchemy import (
Expand Down Expand Up @@ -58,7 +59,7 @@ def get_sqlalchemy_url(self, config: dict) -> str:
else:
secure_options = f"secure={config['secure']}&verify={config['verify']}"
return (
f"clickhouse+{config['driver']}://{config['username']}:{config['password']}@"
f"clickhouse+{config['driver']}://{quote(config['username'])}:{quote(config['password'])}@"
f"{config['host']}:{config['port']}/"
f"{config['database']}?{secure_options}"
)
Expand Down