mirror of
https://github.com/apache/superset.git
synced 2026-05-28 11:15:24 +00:00
fix(mcp): use valid opr value in docstring filter examples; fix dashboard docstring test
- Replace opr:"ct" with opr:"sw" in filter examples in list_datasets, list_charts, and list_dashboards docstrings — "ct" is not a valid ColumnOperatorEnum value, so examples using it produce validation errors - Fix TestDashboardSortableColumns.test_sortable_columns_in_docstring: assertion checked for "Sortable columns for order_column:" (plain text) but docstring uses RST backtick format; split into two substring checks matching "Sortable columns for" and "order_column" separately
This commit is contained in:
@@ -97,7 +97,7 @@ async def list_charts(
|
||||
|
||||
# Correct usage
|
||||
list_charts(request={"search": "revenue", "page": 1, "page_size": 10})
|
||||
list_charts(request={"filters": [{"col": "slice_name", "opr": "ct", "value": "sales"}]})
|
||||
list_charts(request={"filters": [{"col": "slice_name", "opr": "sw", "value": "sales"}]})
|
||||
list_charts() # no arguments returns first page with defaults
|
||||
|
||||
# Wrong — causes pydantic validation errors
|
||||
|
||||
@@ -91,7 +91,7 @@ async def list_dashboards(
|
||||
|
||||
# Correct usage
|
||||
list_dashboards(request={"search": "sales", "page": 1, "page_size": 10})
|
||||
list_dashboards(request={"filters": [{"col": "dashboard_title", "opr": "ct", "value": "exec"}]})
|
||||
list_dashboards(request={"filters": [{"col": "dashboard_title", "opr": "sw", "value": "exec"}]})
|
||||
list_dashboards() # no arguments returns first page with defaults
|
||||
|
||||
# Wrong — causes pydantic validation errors
|
||||
|
||||
@@ -102,7 +102,7 @@ async def list_datasets(
|
||||
|
||||
# Correct usage
|
||||
list_datasets(request={"search": "sales", "page": 1, "page_size": 10})
|
||||
list_datasets(request={"filters": [{"col": "table_name", "opr": "ct", "value": "orders"}]})
|
||||
list_datasets(request={"filters": [{"col": "table_name", "opr": "sw", "value": "orders"}]})
|
||||
list_datasets() # no arguments returns first page with defaults
|
||||
|
||||
# Wrong — causes pydantic validation errors
|
||||
|
||||
@@ -1349,7 +1349,8 @@ class TestDashboardSortableColumns:
|
||||
|
||||
# Check list_dashboards docstring for sortable columns documentation
|
||||
assert list_dashboards.__doc__ is not None
|
||||
assert "Sortable columns for order_column:" in list_dashboards.__doc__
|
||||
assert "Sortable columns for" in list_dashboards.__doc__
|
||||
assert "order_column" in list_dashboards.__doc__
|
||||
for col in SORTABLE_DASHBOARD_COLUMNS:
|
||||
assert col in list_dashboards.__doc__
|
||||
|
||||
|
||||
Reference in New Issue
Block a user