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


##########
tests/integration_tests/tasks/async_queries_tests.py:
##########
@@ -114,7 +120,13 @@ def test_load_chart_data_into_cache_error(
         with pytest.raises(ChartDataQueryFailedError):
             load_chart_data_into_cache(job_metadata, query_context)
 
-        mock_run_command.assert_called_once_with(cache=True)
+        mock_run_command.assert_called_once_with(
+            ChartDataExecutionOptions(
+                mode=ChartDataExecutionMode.CACHE_ONLY,
+                cache_query_context=True,
+                require_cache_writes=True,
+            )
+        )

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Mismatched mock variable name</b></div>
   <div id="fix">
   
   The parameter `mock_run_command` on line 102 does not match the mock created 
by `@mock.patch.object(ChartDataCommand, "execute", ...)` on lines 95-98. The 
unittest.mock framework will generate a variable named `mock_execute`, not 
`mock_run_command`. This causes the assertion on line 123 to reference a 
non-existent variable, making the test fail at runtime.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #63b26f</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