korbit-ai[bot] commented on code in PR #32610:
URL: https://github.com/apache/superset/pull/32610#discussion_r1991549625
##########
superset/db_engine_specs/clickhouse.py:
##########
@@ -414,3 +417,15 @@ def _mutate_label(label: str) -> str:
:return: Conditionally mutated label
"""
return f"{label}_{md5_sha_from_str(label)[:6]}"
+
+ @classmethod
+ def adjust_engine_params(
+ cls,
+ uri: URL,
+ connect_args: dict[str, Any],
+ catalog: str | None = None,
+ schema: str | None = None,
+ ) -> tuple[URL, dict[str, Any]]:
+ if schema:
+ uri = uri.set(database=parse.quote(schema, safe=""))
Review Comment:
### Over-aggressive URL encoding of schema names <sub></sub>
<details>
<summary>Tell me more</summary>
###### What is the issue?
The schema is being URL encoded without preserving any safe characters,
which could lead to compatibility issues with certain schema names containing
valid URL characters.
###### Why this matters
Encoding all characters in the schema name could make certain valid schema
names unusable and prevent connections to databases with schema names
containing standard URL-safe characters.
###### Suggested change ∙ *Feature Preview*
Modify the code to preserve standard URL-safe characters:
```python
if schema:
uri = uri.set(database=parse.quote(schema, safe="/_-."))
```
</details>
<sub>
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/200ec6b1-52c2-4eab-8d5b-3806914f8317?suggestedFixEnabled=true)
💬 Looking for more details? Reply to this comment to chat with Korbit.
</sub>
<!--- korbi internal id:82668cdb-553b-473d-843e-8bd547c0d02d -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]