bito-code-review[bot] commented on code in PR #41924:
URL: https://github.com/apache/superset/pull/41924#discussion_r3557471570


##########
tests/unit_tests/mcp_service/semantic_layer/tool/test_list_metrics.py:
##########
@@ -309,3 +310,236 @@ async def 
test_list_metrics_pagination_is_stable(mcp_server: FastMCP) -> None:
 
     assert data_1["metrics"][0]["name"] == "aaa_metric"
     assert data_2["metrics"][0]["name"] == "zzz_metric"
+
+
[email protected]
+async def test_list_metrics_search_no_match_returns_empty(mcp_server: FastMCP) 
-> None:
+    """A search term that matches nothing returns an empty (not error) 
result."""
+    mock_ds = _make_dataset(1)

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Duplicate mock setup blocks</b></div>
   <div id="fix">
   
   This test file contains syntactic duplicate code patterns across multiple 
test functions. The mock setup involving patch.object for DatasetDAO, 
SemanticViewDAO, and db is duplicated at approximately 6 locations: lines 
176-192, 318-334, 395-409, 424-440, 494-506, and 525-537. Consider extracting 
this into a pytest fixture to reduce duplication and improve maintainability.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #2be639</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



-- 
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]

Reply via email to