fix(contextmenu): uncaught TypeError (#28203)

This commit is contained in:
sowo
2025-03-19 03:42:38 +01:00
committed by GitHub
parent 09ee3e2a1d
commit 29b62f7c0a
5 changed files with 64 additions and 4 deletions

View File

@@ -258,7 +258,12 @@ class QueryObject: # pylint: disable=too-many-instance-attributes
@property
def metric_names(self) -> list[str]:
"""Return metrics names (labels), coerce adhoc metrics to strings."""
return get_metric_names(self.metrics or [])
return get_metric_names(
self.metrics or [],
self.datasource.verbose_map
if self.datasource and hasattr(self.datasource, "verbose_map")
else None,
)
@property
def column_names(self) -> list[str]: