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

   <!-- Bito Reply -->
   The flagged issue is correct. In 
`tests/unit_tests/security/test_sqllab_explore_access_43987.py`, the test 
patches `superset.models.sql_lab.security_manager`, but the `Query.schema_perm` 
property in `superset/models/sql_lab.py` imports `security_manager` from 
`superset.extensions`. Consequently, the mock is not used, and the assertions 
fail.
   
   To resolve this, you should patch `superset.extensions.security_manager` 
instead of `superset.models.sql_lab.security_manager` in your tests.
   
   Would you like me to fetch all other comments on this PR to validate and 
implement fixes for them as well?
   
   **tests/unit_tests/security/test_sqllab_explore_access_43987.py**
   ```
   mock_sm = mocker.patch("superset.extensions.security_manager")
       mock_sm.get_schema_perm.return_value = "[analytics_db].[sales]"
   
       result = Query.schema_perm.fget(q)  # type: ignore[union-attr]
   ```


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