Repository navigation
fix(rename): clarify missing column errors - #19609
Conversation
There was a problem hiding this comment.
Review overview
🟡 Changes recommended
The new message reads better than "does not exist in the input" for a list literal, and CI is green. One thing to fix before merge: when rows come from from json, open or ls, the error still can't say which row lacks the column, which is the #17448 case. The other two are small: where the record wording is drawn, and the release note.
Findings: 0
Open (3)
Notes from my clanker, checked on cbbc2d6. Built the branch, ran cargo test -p nu-command --test tests -- commands::rename (7 passed), and ran each case on the branch binary and on 0.117.1 (main 651f0e4). CI was green on this head.
|
Thanks for the review! rename --column now reports the zero-based row index for lists and streams, so the JSON example identifies the third row as row 2 even when all rows share a source span. Single records omit the index. I moved the row detail to the input label and updated the release note. The JSON array and stream regression tests both pass. |
|
I think we're ready to go but this statement in the description isn't quite right, "This now reports Column 'name' is missing from this input record and highlights {age: 30}. The existing error code is preserved.". It would be good to straighten that out and give an example. |
|
Done @fdncred updated the description |
|
Thanks |



Description
Follow-up to #18108 for #17448.
rename --columncould report that a column was missing from the entire input when only a later record lacked it.[{name: Alice} {age: 30}] | rename -c {name: n}The error now labels
renamewithcannot rename column 'name'. The existing highlight on{age: 30}now saysrow 1 is missing column 'name'. The error code isnu::shell::unsupported_input.User-facing changes (Release notes)
rename --columnnow reports the zero-based index of the input row that is missing a requested column.Additional notes
git diff --checkalso passed.