apache/superset · error · ExtensionNameError

Display name must contain at least one letter or number

Error message

Display name must contain at least one letter or number

What it means

Thrown by validate_display_name() as a defensive backstop: after normalization, the name must contain at least one alphanumeric character. In practice this branch is nearly unreachable because DISPLAY_NAME_REGEX already requires the first character to be a letter — it exists to guarantee the invariant even if the regex is ever relaxed. Seeing it means the normalized name passed the regex yet had no letters/digits, which implies a regex/normalization mismatch.

Source

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

        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


def suggest_technical_name(display_name: str) -> str:
    """
    Suggest technical name from display name.

    Args:
        display_name: Human-readable name (e.g., "Dashboard Widgets!")

    Returns:
        Technical name suggestion (e.g., "dashboard-widgets")
    """
    # Normalize for identifiers
    normalized = _normalize_for_identifiers(display_name)

View on GitHub (pinned to f4587218dd)

Solutions

  1. Include at least one ASCII letter or digit in the display name (e.g. 'Dash ...' -> 'Dash Widgets').
  2. If you maintain a fork and relaxed DISPLAY_NAME_REGEX, keep this alnum guard consistent or update it too.
  3. Avoid display names composed solely of punctuation/symbols.

Example fix

# before
validate_display_name("...")

# after
validate_display_name("Dots Extension ...")
Defensive patterns

Strategy: validation

Validate before calling

normalized = " ".join(display_name.strip().split())
if not any(c.isalnum() for c in normalized):
    raise ValueError("display name needs at least one letter or digit")

Prevention

When it happens

Trigger: A direct call to validate_display_name() with input that normalizes to only special characters (e.g. '...', ' - ', '___') — normally the regex check at line 277 fires first, so hitting this exact line requires the regex to have been changed or a Unicode edge case where characters match the regex but are not str.isalnum().

Common situations: Custom forks that loosened DISPLAY_NAME_REGEX; display names built from Unicode letter-like characters that behave differently between the regex (ASCII-oriented pattern) and str.isalnum(); rarely seen in stock usage.

Related errors


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