{"record":{"id":"eabcb0896e5d6729","repo":"apache/superset","slug":"display-name-cannot-be-empty","errorCode":null,"errorMessage":"Display name cannot be empty","messagePattern":"Display name cannot be empty","errorType":"exception","errorClass":"ExtensionNameError","httpStatus":null,"severity":"error","filePath":"superset-extensions-cli/src/superset_extensions_cli/utils.py","lineNumber":271,"sourceCode":"            \"Extension name must start with a letter and contain only lowercase letters, numbers, and hyphens (e.g., 'dashboard-widgets')\"\n        )\n\n\ndef validate_display_name(display_name: str) -> str:\n    \"\"\"\n    Validate and normalize display name format.\n\n    Args:\n        display_name: Human-readable extension name\n\n    Returns:\n        Cleaned display name\n\n    Raises:\n        ExtensionNameError: If display name is invalid\n    \"\"\"\n    if not display_name or not display_name.strip():\n        raise ExtensionNameError(\"Display name cannot be empty\")\n\n    # Normalize whitespace: strip and collapse multiple spaces\n    normalized = \" \".join(display_name.strip().split())\n\n    if not DISPLAY_NAME_REGEX.match(normalized):\n        raise ExtensionNameError(\n            \"Display name must start with a letter and can contain letters, numbers, spaces, hyphens, underscores, and dots (e.g., 'Dashboard Widgets')\"\n        )\n\n    # Check for only whitespace/special chars after normalization\n    if not any(c.isalnum() for c in normalized):\n        raise ExtensionNameError(\n            \"Display name must contain at least one letter or number\"\n        )\n\n    return normalized\n\n","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset-extensions-cli/src/superset_extensions_cli/utils.py#L253-L289","documentation":"Thrown by validate_display_name() in the superset-extensions CLI when the display name is None, empty, or contains only whitespace after strip(). The display name is the human-readable title of the extension and is normalized (whitespace collapsed) before further checks, so blank input is rejected up front with ExtensionNameError.","triggerScenarios":"Calling a scaffolding prompt non-interactively and passing an empty display name (e.g. `--display-name \"\"` or `\"   \"`), or a programmatic call to validate_display_name('') when a caller substituted an unset variable.","commonSituations":"Interactive prompts answered by pressing Enter in automated terminal sessions; templated scripts where the display-name placeholder was never replaced; YAML/JSON config driving the CLI with a missing display_name key that becomes ''.","solutions":["Provide a non-blank display name such as 'Dashboard Widgets'.","If you do not want to invent one, derive it from the technical name (title-case the slug) instead of passing an empty string.","In scripted runs, assert the variable is non-blank before invoking the CLI to get a clearer failure message."],"exampleFix":"# before\nsuperset-extensions create my-org dashboard-widgets --display-name \"   \"\n\n# after\nsuperset-extensions create my-org dashboard-widgets --display-name \"Dashboard Widgets\"","handlingStrategy":"validation","validationCode":"display_name = (display_name or \"\").strip()\nif not display_name:\n    display_name = technical_name.replace(\"-\", \" \").title()  # fallback derived from slug","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat a blank display name as a configuration error in scripts and provide a derived default."],"tags":["cli","validation","empty-value","extensions"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}