fix(sdk): URL-decode ClickHouse connection-URL credentials and database - #2444
Conversation
_handle_clickhouse_url decoded the password with unquote_plus (turning a literal '+' into a space) and left the username and database name percent-encoded. Use unquote for all three so a connectionUrl like clickhouse://us%40er:pa+ss@host/my%20db yields user 'us@er', password 'pa+ss', and database 'my db'. Matches the connector-level handling already used for mssql/mysql.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis PR fixes ClickHouse connection URL parsing to use ChangesClickHouse Credential Decoding Fix
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)Not applicable; this change is a targeted bug fix without multi-component control flow. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
DataSource.clickhousenow URL-decodes the username, password, and database parsed from aconnectionUrl.unquoteinstead ofunquote_plus, so a literal+in a password is preserved instead of being turned into a space.Motivation
_handle_clickhouse_urlincore/wren/src/wren/model/data_source.py:unquote_plus, which maps+→ space. A ClickHouse password containing a+therefore silently connected with the wrong credential.%40for@,%20for a space) survived as literal text and produced auth/lookup failures.This brings the SDK path in line with the connector-level handling already used for
mssqlandmysql, which useunquote.Verification
The new regression tests fail on
mainand pass with the fix.ruff formatandruff checkclean. Change is confined to Apache-2.0core/wren/**.Summary by CodeRabbit
Bug Fixes
+characters in credentials instead of converting them to spaces.Tests