From 59cbd4c7d84bc41099e98c59f9e4818f5cebdadf Mon Sep 17 00:00:00 2001 From: Develer Date: Tue, 16 Dec 2025 19:35:12 +0100 Subject: [PATCH] allow sql expression on non-frontend ds --- .../PanelDataPane/PanelDataTransformationsTab.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataTransformationsTab.tsx b/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataTransformationsTab.tsx index d1aca477055..a86b6af21a5 100644 --- a/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataTransformationsTab.tsx +++ b/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataTransformationsTab.tsx @@ -104,8 +104,15 @@ export function PanelDataTransformationsTabRendered({ model }: SceneComponentPro const dsSettings = getDataSourceSrv().getInstanceSettings(datasourceRef); - // If we can't get datasource settings or it's not a backend datasource, SQL is not applicable - if (!dsSettings || (!dsSettings.meta.backend && !dsSettings.meta.isBackend)) { + // If we can't get datasource settings, default to allowing SQL expressions + // (we'd rather let the user try than incorrectly block them) + if (!dsSettings) { + continue; + } + + // Only disable for datasources we KNOW are frontend-only + // This is a conservative deny-list approach - we may expand this in future + if (!dsSettings.meta.backend && !dsSettings.meta.isBackend) { return false; } }