{"record":{"id":"550a7dd91daf80cf","repo":"mikefarah/yq","slug":"delpaths-expected-a-sequence-of-sequences-but-fo","errorCode":null,"errorMessage":"DELPATHS: expected a sequence of sequences, but found %v","messagePattern":"DELPATHS: expected a sequence of sequences, but found (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/yqlib/operator_path.go","lineNumber":115,"sourceCode":"\t}\n\treturn context, nil\n}\n\nfunc delPathsOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) {\n\tlog.Debugf(\"delPaths\")\n\t// single RHS expression that returns an array of paths (array of arrays)\n\n\tpathArraysContext, err := d.GetMatchingNodes(context.ReadOnlyClone(), expressionNode.RHS)\n\tif err != nil {\n\t\treturn Context{}, err\n\t}\n\tif pathArraysContext.MatchingNodes.Len() != 1 {\n\t\treturn Context{}, fmt.Errorf(\"DELPATHS: expected single value but found %v\", pathArraysContext.MatchingNodes.Len())\n\t}\n\tpathArraysNode := pathArraysContext.MatchingNodes.Front().Value.(*CandidateNode)\n\n\tif pathArraysNode.Tag != \"!!seq\" {\n\t\treturn Context{}, fmt.Errorf(\"DELPATHS: expected a sequence of sequences, but found %v\", pathArraysNode.Tag)\n\t}\n\n\tupdatedContext := context\n\n\tfor i, child := range pathArraysNode.Content {\n\n\t\tif child.Tag != \"!!seq\" {\n\t\t\treturn Context{}, fmt.Errorf(\"DELPATHS: expected entry [%v] to be a sequence, but its a %v. Note that delpaths takes an array of path arrays, e.g. [[\\\"a\\\", \\\"b\\\"]]\", i, child.Tag)\n\t\t}\n\t\tchildPath, err := getPathArrayFromNode(\"DELPATHS\", child)\n\n\t\tif err != nil {\n\t\t\treturn Context{}, err\n\t\t}\n\n\t\tchildTraversalExp := createTraversalTree(childPath, traversePreferences{}, false)\n\t\tdeleteChildOp := &Operation{OperationType: deleteChildOpType}\n","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/mikefarah/yq/blob/8b5af0694bb82b41d4ae180fac9972029066f90a/pkg/yqlib/operator_path.go#L97-L133","documentation":"The `delpaths` operator expects its argument to be a sequence (array) whose entries are themselves sequences of path segments. This error is thrown when the top-level argument is not an array at all (e.g. a scalar or a map). yq throws it to stop you from passing a malformed path spec that cannot be interpreted as a list of paths.","triggerScenarios":"Calling `delpaths(...)` where the argument expression evaluates to a single non-sequence node — e.g. `yq 'delpaths(\"a\")'`, `delpaths({})`, or `delpaths(.foo)` where .foo is a scalar/map.","commonSituations":"Copy-pasting jq-style single-path usage like `delpaths([\"a\",\"b\"])` without the extra nesting level; accidentally selecting a scalar/map instead of an array of paths; forgetting that delpaths takes `[[\"a\"]]` not `[\"a\"]`.","solutions":["Wrap the argument as an array of path arrays: use `delpaths([\"a\"])` instead of `delpaths(\"a\")`.","Verify the expression feeding delpaths evaluates to a sequence: `select(tag == \"!!seq\")` or inspect with `tag`.","If deleting a single path, either use `del(.a.b)` or pass `delpaths([[\"a\",\"b\"]])`.","If the argument comes from data, ensure it is an array of arrays, e.g. `[paths]` style construction."],"exampleFix":"// before\nyq 'delpaths(\"a.b\")' file.yml\n// after\nyq 'delpaths([[\"a\", \"b\"]])' file.yml","handlingStrategy":"validation","validationCode":"paths=$(yq -o=json '[paths]' file.yml); yq --argjson p \"$paths\" 'delpaths($p)' file.yml  # ensure argument is an array of arrays","typeGuard":"isPathArrays() { [ \"$(yq 'tag == \"!!seq\" and (map(tag == \"!!seq\") | all)' <<< \"$1\")\" = \"true\" ]; }","tryCatchPattern":null,"preventionTips":["Always pass delpaths an array of path arrays: [[\"a\",\"b\"]].","Use del(.path) for single-path deletions to avoid nesting confusion.","Check the tag of the argument expression before calling delpaths.","Never feed scalar/map data directly into delpaths."],"tags":["yq","delpaths","type-mismatch","argument-validation"],"backgroundTag":"delpaths-invalid-path-argument","analyzedSha":"8b5af0694bb82b41d4ae180fac9972029066f90a","analyzedAt":"2026-09-05T10:57:22.766Z","contentChangedAt":"2026-09-05T10:57:22.766Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}