rusackas commented on code in PR #37516:
URL: https://github.com/apache/superset/pull/37516#discussion_r3656234205
##########
superset/common/query_context.py:
##########
@@ -131,6 +150,21 @@ def get_df_payload(
force_cached=force_cached,
)
+ def get_df_payload_result(
+ self,
+ query_obj: QueryObject,
+ force_cached: bool | None = False,
+ source_kind: SourceKind = SourceKind.PRIMARY,
+ cache_key_extra: Mapping[str, Any] | None = None,
+ ) -> QueryAcquisitionResult:
+ """Acquire a dataframe with timing kept outside the payload."""
+ return self._processor.get_df_payload_result(
+ query_obj=query_obj,
+ force_cached=force_cached,
+ source_kind=source_kind,
+ cache_key_extra=cache_key_extra,
+ )
Review Comment:
Same answer as the `get_payload_result` thread above.
`get_df_payload_result()` follows the existing `get_df_payload()` pattern, and
the caller already enforces `raise_for_access()` before this runs.
##########
superset/common/query_context_processor.py:
##########
@@ -551,7 +1013,7 @@ def raise_for_access(self) -> None:
# come first to avoid rendering caller-supplied input for a resource
the
# caller is not allowed to access.
if self._qc_datasource.type == DatasourceType.QUERY:
- security_manager.raise_for_access(query=self._qc_datasource)
+ cast("SqlLabQuery", self._qc_datasource).raise_for_explore_access()
else:
security_manager.raise_for_access(query_context=self._query_context)
Review Comment:
`raise_for_explore_access()` (used here for `DatasourceType.QUERY`) calls
`security_manager.raise_for_access(database=..., rendered_sql=...,
force_dataset_match=True)` internally, plus an owner check. Same centralized
gate, just routed through the query-specific path since SQL Lab backed queries
need the rendered SQL rather than a datasource object.
--
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]