villebro opened a new pull request, #44187:
URL: https://github.com/apache/superset/pull/44187

   ### SUMMARY
   `master` is failing the mypy pre-commit/CI check on 
`tests/unit_tests/semantic_layers/values_endpoint_test.py`:
   
   ```
   tests/unit_tests/semantic_layers/values_endpoint_test.py:109: error: 
"Callable[[Dimension, set[Filter] | None], SemanticResult]" has no attribute 
"call_args"  [attr-defined]
   ```
   
   The test binds `implementation = semantic_view_datasource.implementation`. 
The `SemanticView.implementation` property is typed to return 
`SemanticViewABC`, so mypy sees `implementation.get_values` as the real 
`Callable` and rejects the `.call_args` mock attribute. At runtime the object 
is a `MagicMock` patched in the `semantic_view_datasource` fixture, so the test 
passes — only mypy was unhappy. Casting the mock-backed implementation to 
`MagicMock` (already imported) tells mypy the attributes are `Any`, matching 
runtime reality, and leaves the assertion unchanged.
   
   ### TESTING INSTRUCTIONS
   ```
   pre-commit run mypy --files 
tests/unit_tests/semantic_layers/values_endpoint_test.py
   ```
   mypy passes with the change.
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


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