rusackas commented on code in PR #38807:
URL: https://github.com/apache/superset/pull/38807#discussion_r3327124497
##########
superset/commands/datasource/list.py:
##########
@@ -151,6 +152,27 @@ def _serialize_rows(rows: list[Any]) -> list[dict[str,
Any]]:
if sv_obj:
result.append(_semantic_view_schema.dump(sv_obj))
+ # Inject RLS summaries for dataset entries so the combined list
+ # includes the same `rls_filters` summary shape available on
+ # the standalone dataset list endpoint.
+ dataset_ids = [
+ item["id"] for item in result if item.get("source_type") ==
"database"
+ ]
+ if dataset_ids:
+ try:
+ rls_map = DatasetDAO.get_rls_filters_for_datasets(dataset_ids)
+ for item in result:
+ if item.get("source_type") == "database":
+ item_id = item.get("id")
+ if isinstance(item_id, int):
+ item["rls_filters"] = rls_map.get(item_id, [])
+ else:
+ item["rls_filters"] = []
+ except Exception: # pragma: no cover - defensive
+ logger.exception(
+ "Failed to inject RLS summaries into combined datasource
list"
+ )
Review Comment:
@SkinnyPigeon thanks for the other changes... maybe we want to fix this one
too?
--
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]