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

   <!-- Bito Reply -->
   The suggestion is valid. The current test only verifies that `logger.debug` 
was called, which is insufficient to ensure the correct diagnostic message and 
expression are logged. You can improve the test by asserting the specific 
arguments passed to the logger.
   
   Here is the updated test code:
   
   ```python
       with patch("superset.utils.core.logger.debug") as mock_debug:
           assert (get_metric_type_from_column(column, datasource)) == ""
           mock_debug.assert_called_once_with(
               "Unexpected metric expression type: %s", "INVALID(my_column)"
           )
   ```
   
   I have checked the PR and there are no other comments to address. Would you 
like me to help with anything else?
   
   **tests/unit_tests/utils/map_type_tests.py**
   ```
   with patch("superset.utils.core.logger.debug") as mock_debug:
           assert (get_metric_type_from_column(column, datasource)) == ""
           mock_debug.assert_called_once_with(
               "Unexpected metric expression type: %s", "INVALID(my_column)"
           )
   ```


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