fix(core): reduce metric expression log noise - #42619
Conversation
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #42619 +/- ##
==========================================
- Coverage 65.44% 65.44% -0.01%
==========================================
Files 2810 2810
Lines 159362 159362
Branches 36372 36372
==========================================
- Hits 104301 104291 -10
- Misses 53019 53028 +9
- Partials 2042 2043 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
The suggestion is valid. The current test only verifies that Here is the updated test code: 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 |
Code Review Agent Run #ab286bActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
SUMMARY
Metric expressions that do not match the built-in aggregation pattern are a supported fallback:
get_metric_type_from_columnreturns an empty inferred type for them. Logging this case at warning level creates repeated noise when dataframe types are inferred across query result columns.This changes the existing message from warning to debug level while preserving its text and arguments. The unit test is updated to verify the debug call.
TESTING INSTRUCTIONS
Run:
Verified locally: 11 tests passed, and all pre-commit hooks applicable to the changed files passed.
ADDITIONAL INFORMATION
Blast radius
Backend logging only. There are no behavior, API, database, security, or UI changes.
Risk and rollback
Low risk: unexpected metric expressions remain observable at debug level. Roll back by reverting the commit.
Review guidance
Review the log-level change in
superset/utils/core.pyand its matching unit-test expectation.