affaan-m/ECC · error · ValueError

nonempty text required

Error message

nonempty text required

What it means

_text requires its argument to be a Python str with at least one non-whitespace character, otherwise it raises ValueError('nonempty text required'). Bundle identity/description/name fields must be meaningful strings.

Solutions

  1. Provide a non-empty string for the flagged field
  2. Convert non-string identifiers with str(...) before building the bundle
  3. Add a pre-validation pass rejecting empty/blank strings for required text fields

Example fix

// before
binding = {"description": "", ...}
// after
binding = {"description": "match cut from scene 3", ...}
Defensive patterns

Strategy: type-guard

Validate before calling

texts = [v for v in fields.values() if isinstance(v, str)]
assert all(t.strip() for t in texts), "blank text field in bundle"

Type guard

def is_nonempty_text(v) -> bool:
    return isinstance(v, str) and bool(v.strip())

Try / catch

try:
    bundle = build_application_bundle(data)
except ValueError as e:
    if "nonempty text" in str(e):
        print("a text field is empty or not a string; check bundle fields")
    else:
        raise

Prevention

When it happens

Trigger: Passing None, an integer, or an empty/whitespace-only string for any validated text field (artifact path, snapshot id, binding description, candidate name, clip name).

Common situations: Templated bundle generation where an optional field defaulted to "", YAML that parses blank values as None, or numeric ids passed where string ids are required.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/e923acf53a81c03c. Report an issue: GitHub.

Appendix: source

Thrown at skills/taste-application/scripts/tasteforge/integration.py:49

    except (TypeError, ValueError, RecursionError) as exc:
        raise ValueError("bundle values must be finite JSON data") from exc


def _digest(value: Any) -> str:
    return hashlib.sha256(_canonical(value)).hexdigest()


def _object(value: Any, required: set[str], optional: set[str] | None = None) -> dict:
    if not isinstance(value, dict) or not required <= value.keys():
        raise ValueError("missing required bundle fields")
    if value.keys() - required - (optional or set()):
        raise ValueError("unknown bundle fields")
    return value


def _text(value: Any) -> str:
    if not isinstance(value, str) or not value.strip():
        raise ValueError("nonempty text required")
    return value


def _integer(value: Any, minimum: int = 0) -> int:
    if type(value) is not int or value < minimum:
        raise ValueError("frame/count must be an exact integer in range")
    return value


def _rate(value: Any) -> tuple[int, int]:
    _object(value, {"numerator", "denominator"})
    n, d = (_integer(value[k], 1) for k in ("numerator", "denominator"))
    if math.gcd(n, d) != 1:
        raise ValueError("fps must be a reduced positive rational")
    return n, d


def _range(value: Any, bounds: list[int] | None = None) -> list[int]:

View on GitHub (pinned to 8321021c54)