bito-code-review[bot] commented on PR #41867:
URL: https://github.com/apache/superset/pull/41867#issuecomment-5125518838

   <!-- Bito Reply -->
   The review suggestion is correct. The current test only verifies the 
`ClickHouseBaseEngineSpec` directly, which does not guarantee that the 
dialect-specific rendering logic is correctly applied when using a concrete 
engine spec or the full ClickHouse dialect in production. To resolve this, you 
should add a test case that uses a concrete ClickHouse engine spec and a 
computed expression to ensure the boolean filter rendering behaves as expected.
   
   Here is a suggested test addition for 
`tests/unit_tests/db_engine_specs/test_clickhouse.py`:
   
   ```python
   def test_handle_boolean_filter_with_computed_expression() -> None:
       from sqlalchemy import Boolean, Column, literal
       from superset.db_engine_specs.clickhouse import ClickHouseEngineSpec
       from superset.utils.core import FilterOperator
   
       # Simulate a computed expression: (expiration = 1)
       computed_expr = (literal(1) == 1).label("expiration")
       
       result = ClickHouseEngineSpec.handle_boolean_filter(
           computed_expr, FilterOperator.IS_TRUE, True
       )
       assert str(result.compile(compile_kwargs={"literal_binds": True})) == 
"(1 = 1) = true"
   ```
   
   There are no other comments on this PR to address. Would you like me to help 
with anything else?
   
   **tests/unit_tests/db_engine_specs/test_clickhouse.py**
   ```
   def test_handle_boolean_filter_with_computed_expression() -> None:
       from sqlalchemy import Boolean, Column, literal
       from superset.db_engine_specs.clickhouse import ClickHouseEngineSpec
       from superset.utils.core import FilterOperator
   
       # Simulate a computed expression: (expiration = 1)
       computed_expr = (literal(1) == 1).label("expiration")
       
       result = ClickHouseEngineSpec.handle_boolean_filter(
           computed_expr, FilterOperator.IS_TRUE, True
       )
       assert str(result.compile(compile_kwargs={"literal_binds": True})) == 
"(1 = 1) = true"
   ```


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