You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org> on 2026/09/21 09:31:47 UTC
Re: [PR] feat(motherduck): set session_name on user impersonation [superset]
codeant-ai-for-open-source[bot] commented on code in PR #42705:
URL: https://github.com/apache/superset/pull/42705#discussion_r4060825516
##########
superset/db_engine_specs/duckdb.py:
##########
@@ -369,6 +369,38 @@ def get_extra_params(
return extra
+ @classmethod
+ def impersonate_user(
+ cls,
+ database: Database,
+ username: str | None,
+ user_token: str | None,
+ url: URL,
+ engine_kwargs: dict[str, Any],
+ ) -> tuple[URL, dict[str, Any]]:
+ # Local DuckDB has no user concept, and the base implementation's
+ # username-in-URL is passed by duckdb-engine as a connect() kwarg
+ # that duckdb rejects -- so never call it. Note that md: databases
+ # also resolve to this spec (spec lookup is by backend name only,
+ # and MotherDuck shares the duckdb:// scheme).
+ if username is None or not (url.database or "").startswith("md:"):
+ return url, engine_kwargs
Review Comment:
✅ **CodeAnt verified this suggestion was addressed in subsequent commits and marked this thread resolved** as of `e41c970`.
The method now clears the URL username immediately with `url = url._replace(username=None)` before the early return or MotherDuck URL construction.
<sub>If that's not right, unresolve this thread and CodeAnt will leave it open.</sub>
<!-- codeant-auto-resolve-reply -->
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org