apache/superset · error · ExtensionNameError

Display name cannot be empty

Error message

Display name cannot be empty

What it means

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.

Source

Thrown at superset-extensions-cli/src/superset_extensions_cli/utils.py:271

            "Extension name must start with a letter and contain only lowercase letters, numbers, and hyphens (e.g., 'dashboard-widgets')"
        )


def validate_display_name(display_name: str) -> str:
    """
    Validate and normalize display name format.

    Args:
        display_name: Human-readable extension name

    Returns:
        Cleaned display name

    Raises:
        ExtensionNameError: If display name is invalid
    """
    if not display_name or not display_name.strip():
        raise ExtensionNameError("Display name cannot be empty")

    # Normalize whitespace: strip and collapse multiple spaces
    normalized = " ".join(display_name.strip().split())

    if not DISPLAY_NAME_REGEX.match(normalized):
        raise ExtensionNameError(
            "Display name must start with a letter and can contain letters, numbers, spaces, hyphens, underscores, and dots (e.g., 'Dashboard Widgets')"
        )

    # Check for only whitespace/special chars after normalization
    if not any(c.isalnum() for c in normalized):
        raise ExtensionNameError(
            "Display name must contain at least one letter or number"
        )

    return normalized

View on GitHub (pinned to f4587218dd)

Solutions

  1. Provide a non-blank display name such as 'Dashboard Widgets'.
  2. If you do not want to invent one, derive it from the technical name (title-case the slug) instead of passing an empty string.
  3. In scripted runs, assert the variable is non-blank before invoking the CLI to get a clearer failure message.

Example fix

# before
superset-extensions create my-org dashboard-widgets --display-name "   "

# after
superset-extensions create my-org dashboard-widgets --display-name "Dashboard Widgets"
Defensive patterns

Strategy: validation

Validate before calling

display_name = (display_name or "").strip()
if not display_name:
    display_name = technical_name.replace("-", " ").title()  # fallback derived from slug

Prevention

When it happens

Trigger: 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.

Common situations: 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 ''.

Related errors


AI-assisted analysis of apache/superset@f4587218dd (2026-08-14). Data as JSON: /api/errors/eabcb0896e5d6729. Report an issue: GitHub.