codeant-ai-for-open-source[bot] commented on code in PR #45894:
URL: https://github.com/apache/superset/pull/45894#discussion_r4426786651
##########
superset/core/api/core_api_injection.py:
##########
@@ -23,17 +23,52 @@
to be used with direct imports while maintaining loose coupling.
"""
+from functools import wraps
from typing import Any, Callable, TYPE_CHECKING, TypeVar
from sqlalchemy.orm import scoped_session
-from superset.extensions.context import get_current_extension_context
+from superset.extensions.context import (
+ extension_context,
+ get_current_extension_context,
+)
+from superset.utils.core import get_user_id
if TYPE_CHECKING:
from superset_core.common.models import Database
+ from superset_core.extensions.types import Manifest
from superset_core.rest_api.api import RestApi
+def _contextualize_extension_api(
+ api_class: type["RestApi"],
+ manifest: "Manifest",
+) -> None:
+ """Execute exposed extension API methods with extension and user
context."""
+ for attribute_name, attribute in vars(api_class).items():
Review Comment:
✅ **CodeAnt verified this suggestion was addressed in subsequent commits and
marked this thread resolved** as of `cae4cef`.
The handler scan now uses `dir(api_class)`, which includes inherited
attributes, and wraps exposed inherited methods on the API class.
<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: [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]