{"record":{"id":"34c60f6a3b8ba40c","repo":"apache/superset","slug":"group-by-param-is-required","errorCode":null,"errorMessage":"Group by param is required","messagePattern":"Group by param is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"superset-frontend/plugins/plugin-chart-paired-t-test/src/TTestTable.tsx","lineNumber":271,"sourceCode":"      if (row === control) {\n        return 'control';\n      }\n\n      // p-values significant below set threshold\n      return Number(pValues[row]) <= alpha;\n    },\n    [control, pValues, alpha],\n  );\n\n  const handleRowClick = useCallback(\n    (rowIndex: number) => {\n      computeTTest(rowIndex);\n    },\n    [computeTTest],\n  );\n\n  if (!Array.isArray(groups) || groups.length === 0) {\n    throw new Error('Group by param is required');\n  }\n\n  // Map a status keyword to its theme color; the control/significant/lift\n  // states reuse the semantic antd tokens.\n  const statusColor = (status: string): string | undefined => {\n    switch (status) {\n      case 'control':\n        return theme.colorPrimary;\n      case 'true':\n        return theme.colorSuccess;\n      case 'false':\n        return theme.colorError;\n      case 'invalid':\n        return theme.colorWarning;\n      default:\n        return undefined;\n    }\n  };","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset-frontend/plugins/plugin-chart-paired-t-test/src/TTestTable.tsx#L253-L289","documentation":"TTestTable (Paired t-test chart) requires at least one Group By column to compute groups; the component throws when the groups array from form_data is missing or empty. Without a group dimension there is nothing to stratify the t-test by, so rendering aborts.","triggerScenarios":"Opening a Paired t-test chart whose form_data has no groupby; a dashboard import where the groupby array was dropped; data-mask/URL params overwriting groupby with an empty list.","commonSituations":"Chart saved before Group By was configured; explore URL params (e.g. preselect_filters or permalink) clearing groupby; migrating charts between Superset versions with schema changes to groupby.","solutions":["Open the chart in Explore and set at least one Group By column, then save.","Fix imported chart JSON so formData.groupby is a non-empty array of valid columns.","When generating permalinks/URLs programmatically, do not send groupby: [].","Guard the chart container with an error boundary so one bad chart does not break the whole dashboard."],"exampleFix":"// before\n\"groupby\": [],\n\n// after\n\"groupby\": [\"group\"],","handlingStrategy":"validation","validationCode":"import { ensureIsArray } from '@superset-ui/core';\n\nconst hasGroupBy = Array.isArray(groups) && groups.length > 0;\nif (!hasGroupBy) {\n  // render configuration hint instead of mounting TTestTable\n}","typeGuard":"function hasGroupbyColumns(formData: unknown): formData is { groupby: string[] } {\n  return (\n    !!formData &&\n    typeof formData === 'object' &&\n    Array.isArray((formData as { groupby?: unknown }).groupby) &&\n    ((formData as { groupby: unknown[] }).groupby.length as number) > 0\n  );\n}","tryCatchPattern":"<ErrorBoundary fallbackRender={() => <Alert type=\"error\" message={t('Paired t-test requires a Group By column')} />}>\n  <TTestTable ... />\n</ErrorBoundary>","preventionTips":["Make Group By a required control for the Paired t-test chart in Explore before save.","Validate groupby is non-empty when importing dashboards containing t-test charts.","Avoid URL/permalink overrides that blank out groupby."],"tags":["visualization","paired-t-test","form-data","groupby"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}