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

   <!-- Bito Reply -->
   The flagged issue is correct. The current test implementation is limited to 
the `starrocks` dialect, which risks leaving other dialects that use 
`FORCE_LIMIT` (such as MySQL, Hive, or Trino) vulnerable to the same 
regression. To resolve this, you should parameterize the test to include these 
dialects or assert the behavior in a dialect-independent manner.
   
   Here is a suggested update to parameterize the test:
   
   ```python
   @pytest.mark.parametrize(
       "sql, dialect",
       [
           ("SHOW TABLES", "starrocks"),
           ("SHOW TABLES", "mysql"),
           ("SHOW TABLES", "hive"),
           ("SHOW TABLES", "trino"),
       ],
   )
   def test_set_limit_value_leaves_show_statements_unchanged(sql: str, dialect: 
str) -> None:
       statement = SQLStatement(sql, dialect)
       original = statement.format()
       statement.set_limit_value(1000, LimitMethod.FORCE_LIMIT)
       assert statement.format() == original
       assert "LIMIT" not in statement.format()
   ```
   
   There are no other comments in the PR to address. Would you like me to check 
for any other potential improvements in this file?
   
   **tests/unit_tests/sql/parse_tests.py**
   ```
   @pytest.mark.parametrize(
       "sql, dialect",
       [
           ("SHOW TABLES", "starrocks"),
           ("SHOW TABLES", "mysql"),
           ("SHOW TABLES", "hive"),
           ("SHOW TABLES", "trino"),
       ],
   )
   def test_set_limit_value_leaves_show_statements_unchanged(sql: str, dialect: 
str) -> None:
       statement = SQLStatement(sql, dialect)
       original = statement.format()
       statement.set_limit_value(1000, LimitMethod.FORCE_LIMIT)
       assert statement.format() == original
       assert "LIMIT" not in statement.format()
   ```


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