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


##########
tests/integration_tests/sqla_models_tests.py:
##########
@@ -841,6 +841,15 @@ def test_none_operand_in_filter(login_as_admin, 
physical_dataset):
             [],
             True,
         ),
+        (
+            "test_has_extra_cache_keys_cache_key_wrapper_with_fn_arg",
+            """
+            SELECT
+            '{{ cache_key_wrapper(my_func()) }}' as user_id

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Undefined Jinja function in test</b></div>
   <div id="fix">
   
   The added test case uses 'my_func()' in the Jinja template, but this 
function is not defined in the template context. Jinja will raise an 
UndefinedError when rendering, causing the test to fail. Since the expected 
cache keys include {1} and current_user_id() is mocked to return 1, consider 
using 'current_user_id()' instead.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ````suggestion
               '{{ cache_key_wrapper(current_user_id()) }}' as user_id
   ````
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #2600f9</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



##########
tests/unit_tests/jinja_context_test.py:
##########
@@ -1693,3 +1693,24 @@ def 
test_undefined_template_variable_not_function(mocker: MockerFixture) -> None
     template = "SELECT {{ undefined_variable.some_method() }}"
     with pytest.raises(UndefinedError):
         processor.process_template(template)
+
+
[email protected](
+    "sql,expected",

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Parametrize decorator expects tuple not string</b></div>
   <div id="fix">
   
   The `@pytest.mark.parametrize` decorator on line 1699 uses a string for the 
first argument instead of a tuple. Change `"sql,expected"` to `("sql", 
"expected")` to match pytest's expected format.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ````suggestion
   @pytest.mark.parametrize(
       ("sql", "expected"),
   ````
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #2600f9</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