aminghadersohi opened a new pull request, #36295: URL: https://github.com/apache/superset/pull/36295
### SUMMARY Fixed two failing unit tests in the MCP dataset tools test suite that were incorrectly calling a decorated function. The `list_datasets` function is decorated with `@tool` from `superset_core.mcp`, which wraps the function in a `FunctionTool` object. The tests were attempting to call the decorator wrapper directly instead of the underlying wrapped function, resulting in `TypeError: 'FunctionTool' object is not callable`. The fix updates the tests to use `list_datasets.__wrapped__()` to access and call the actual implementation function. **Failing tests:** - `TestDatasetSortableColumns::test_list_datasets_with_valid_order_column` - `TestDatasetSortableColumns::test_default_ordering` ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF N/A - Test fix only ### TESTING INSTRUCTIONS 1. Run the previously failing tests: ```bash pytest tests/unit_tests/mcp_service/dataset/tool/test_dataset_tools.py::TestDatasetSortableColumns::test_list_datasets_with_valid_order_column pytest tests/unit_tests/mcp_service/dataset/tool/test_dataset_tools.py::TestDatasetSortableColumns::test_default_ordering ``` 2. Verify all tests in the file pass: ```bash pytest tests/unit_tests/mcp_service/dataset/tool/test_dataset_tools.py -v ``` Expected: All 20 tests pass ### 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]
