Skip to content

nonempty

Written as nonempty(argnum flags):options in a transform expression.

Minimum arguments 1
Maximum arguments no limit
Default arguments 1
Argument modes SINGLE_PRIMITIVE, SINGLE_ARRAY, SINGLE_DICT, MULTIPLE_ARRAYS, MULTIPLE_DICTS

Validate that input arguments are non-empty.

This transform checks that none of the provided arguments are empty strings, None, or empty collections. If any empty value is found, it raises NonEmptyAssertError.

Validation Rules:

  • Strings: Must have length > 0 (whitespace-only counts as empty)
  • Collections (list, dict, set, tuple): Must have len > 0
  • None: Always considered empty
  • Other types: Considered non-empty if not None

Notes:

  • Accepts unlimited number of arguments (_max_arg_num = -1)
  • Returns original arguments unchanged (meaning output spread is enabled as default) if validation passes
  • Raises NonEmptyAssertError immediately on first empty value found
  • Useful for input validation in transformation pipelines
  • Error message includes all arguments for debugging
Flag Letter
spread_input s
spread_output S
noncaptive_input I
arg_num_flexible f
Input args: ["hello"]
Transforms: "nonempty:"
Output: ["hello"]
Input args: []
Transforms: "nonempty:"
Output: N/A
Error: "Fails non-empty assert"
Input args: ["hello","world"]
Transforms: "nonempty(*):"
Output: ["hello","world"]
Input args: ["hello",""]
Transforms: "nonempty(*):"
Output: N/A
Error: "Fails non-empty assert"
Input args: [[1,2,3]]
Transforms: "nonempty:"
Output: [[1,2,3]]
Input args: []
Transforms: "nonempty:"
Output: N/A
Error: "Fails non-empty assert"