aminghadersohi opened a new pull request, #41925: URL: https://github.com/apache/superset/pull/41925
### SUMMARY `query_dataset`'s `@requires_data_model_metadata_access` decorator was placed outside `@tool(...)` instead of below it — the opposite order used by every other data-model-restricted MCP tool (`list_datasets`, `get_dataset_info`, `list_databases`, `get_database_info`, `get_dashboard_datasets`, `get_compatible_metrics`, `get_compatible_dimensions`, `list_metrics`, `get_table`). This PR moves it below `@tool(...)` to match convention, and adds regression tests verifying `query_dataset` is correctly hidden from `tools/list` for metadata-restricted users, mirroring the existing coverage for `list_datasets`/`get_dataset_info`. Call-time enforcement was never affected — `query_dataset.py`'s inline `user_can_view_data_model_metadata()` check always denied restricted callers correctly. This change is about decorator consistency and `tools/list` visibility metadata, verified locally with tests that call the actual FastMCP-registered tool object (not just the module-level function reference). ### TESTING INSTRUCTIONS - `pytest tests/unit_tests/mcp_service/dataset/tool/test_query_dataset.py tests/unit_tests/mcp_service/test_privacy.py tests/unit_tests/mcp_service/test_auth_rbac.py tests/unit_tests/mcp_service/dataset/tool/test_dataset_tools.py` — all pass (137 tests) - `pre-commit run --files superset/mcp_service/dataset/tool/query_dataset.py tests/unit_tests/mcp_service/dataset/tool/test_query_dataset.py` — passes ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- 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]
