aminghadersohi commented on code in PR #41698:
URL: https://github.com/apache/superset/pull/41698#discussion_r3546896589
##########
tests/unit_tests/mcp_service/dashboard/test_dashboard_schemas.py:
##########
@@ -885,6 +886,32 @@ def test_client_supplied_warnings_are_discarded(self) ->
None:
assert req.sanitization_warnings == []
+class TestDashboardInfoLargeListGuidance:
+ """DashboardInfo documents how agents can retrieve charts/native_filters
+ beyond the response-size guard's list-item cap.
+
+ Regression test for the Medialab large-dashboard report: with the old
+ hardcoded 30-item cap and no documented escape hatch, agents had no way
+ to retrieve the rest of a dashboard's charts. These field descriptions
+ are the "documented, agent-usable way to access items beyond the cap"
+ called for by the story's acceptance criteria.
+ """
+
+ def test_charts_field_documents_list_charts_escape_hatch(self) -> None:
+ """The charts field description points to list_charts pagination."""
+ description = DashboardInfo.model_fields["charts"].description
+ assert description is not None
+ assert "list_charts" in description
+ assert "dashboards" in description
+ assert "chart_count" in description
+
Review Comment:
Fixed in 8a75f54. Added `description: str | None = ...` annotation to the
local variable.
##########
tests/unit_tests/mcp_service/dashboard/test_dashboard_schemas.py:
##########
@@ -885,6 +886,32 @@ def test_client_supplied_warnings_are_discarded(self) ->
None:
assert req.sanitization_warnings == []
+class TestDashboardInfoLargeListGuidance:
+ """DashboardInfo documents how agents can retrieve charts/native_filters
+ beyond the response-size guard's list-item cap.
+
+ Regression test for the Medialab large-dashboard report: with the old
+ hardcoded 30-item cap and no documented escape hatch, agents had no way
+ to retrieve the rest of a dashboard's charts. These field descriptions
+ are the "documented, agent-usable way to access items beyond the cap"
+ called for by the story's acceptance criteria.
+ """
+
+ def test_charts_field_documents_list_charts_escape_hatch(self) -> None:
+ """The charts field description points to list_charts pagination."""
+ description = DashboardInfo.model_fields["charts"].description
+ assert description is not None
+ assert "list_charts" in description
+ assert "dashboards" in description
+ assert "chart_count" in description
+
+ def test_native_filters_field_documents_max_list_items_config(self) ->
None:
+ """The native_filters field description mentions the configurable
cap."""
+ description = DashboardInfo.model_fields["native_filters"].description
+ assert description is not None
+ assert "max_list_items" in description
+
Review Comment:
Fixed in 8a75f54. Added `description: str | None = ...` annotation to the
local variable.
--
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]