Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion superset/utils/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1797,7 +1797,7 @@ def get_metric_type_from_column(column: Any, datasource: Explorable) -> str:
operation = match.group(1)
return METRIC_MAP_TYPE.get(operation, "")

logger.warning("Unexpected metric expression type: %s", expression)
logger.debug("Unexpected metric expression type: %s", expression)
return ""


Expand Down
6 changes: 4 additions & 2 deletions tests/unit_tests/utils/map_type_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ def test_column_with_invalid_operation():
metric = SqlMetric(metric_name="my_column", expression="INVALID(my_column)")
datasource = MagicMock(metrics=[metric])
column = "my_column"
with patch("superset.utils.core.logger.warning") as mock_warning:
with patch("superset.utils.core.logger.debug") as mock_debug:
assert (get_metric_type_from_column(column, datasource)) == ""
mock_warning.assert_called_once()
mock_debug.assert_called_once_with(
"Unexpected metric expression type: %s", "INVALID(my_column)"
)


def test_empty_datasource():
Expand Down
Loading