bito-code-review[bot] commented on PR #41427:
URL: https://github.com/apache/superset/pull/41427#issuecomment-4801496839
<!-- Bito Reply -->
The suggestion to add type hints to the newly added test methods is correct,
as it aligns with standard Python practices for maintaining type safety in test
suites. You can resolve this by adding the `unittest.mock.MagicMock` type to
the mock parameters and `None` as the return type.
Would you like me to apply this change to the other similar test methods
added in this PR as well?
**tests/unit_tests/models/test_validate_expression.py**
```
@patch("superset.models.helpers.is_feature_enabled", return_value=False)
@patch("superset.connectors.sqla.models.SqlaTable._execute_validation_query")
def test_validate_expression_rejects_subquery(
self, mock_execute: MagicMock, mock_ff: MagicMock
) -> None:
"""A sub-query expression is rejected by the same
validate_adhoc_subquery
gate used for stored adhoc expressions, before any validation query
is
built or run (with ALLOW_ADHOC_SUBQUERY off, the default). Locks in
that
expression validation never executes the sub-query."""
```
--
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]