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


##########
tests/unit_tests/db_engine_specs/test_kusto.py:
##########
@@ -139,3 +139,71 @@ def test_timegrain_expressions(in_duration: str, 
expected_result: str) -> None:
         col=col, pdf=None, time_grain=in_duration
     )
     assert str(actual_result) == expected_result
+
+
+def test_epoch_to_dttm() -> None:
+    """
+    Test that KQL engine spec returns correct epoch to datetime conversion 
template.
+    """
+    result = KustoKqlEngineSpec.epoch_to_dttm()
+    assert result == "unixtime_seconds_todatetime({col})"
+
+
+def test_epoch_ms_to_dttm() -> None:
+    """
+    Test that KQL engine spec returns correct epoch milliseconds to datetime 
conversion template.
+    """
+    result = KustoKqlEngineSpec.epoch_ms_to_dttm()
+    assert result == "unixtime_milliseconds_todatetime({col})"
+
+
+def test_handle_null_filter() -> None:
+    """
+    Test that KQL engine spec uses isnull/isnotnull functions for null filters.
+    """
+    from superset.utils.core import FilterOperator
+
+    test_col = column("test_column")
+
+    # Test IS_NULL - should return isnull(col)
+    result_null = KustoKqlEngineSpec.handle_null_filter(
+        test_col, FilterOperator.IS_NULL
+    )
+    assert str(result_null) == "isnull(test_column)"
+
+    # Test IS_NOT_NULL - should return isnotnull(col)
+    result_not_null = KustoKqlEngineSpec.handle_null_filter(
+        test_col, FilterOperator.IS_NOT_NULL
+    )
+    assert str(result_not_null) == "isnotnull(test_column)"
+
+    # Test invalid operator - should raise ValueError
+    with pytest.raises(ValueError, match="Invalid null filter operator"):
+        KustoKqlEngineSpec.handle_null_filter(test_col, "INVALID_OPERATOR")
+
+
[email protected](
+    "raw_query,expected_query",

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Incorrect parametrize argument type</b></div>
   <div id="fix">
   
   Change the first argument of `@pytest.mark.parametrize` from a string to a 
tuple: `("raw_query", "expected_query")` instead of 
`"raw_query,expected_query"`.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ````suggestion
       ("raw_query", "expected_query"),
   ````
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #5fbda0</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