Repository navigation
feat(from xlsx): add support for header row - #18189
Conversation
| .named( | ||
| "header-row", | ||
| SyntaxShape::OneOf(vec![SyntaxShape::Int, SyntaxShape::Nothing]), | ||
| "Specify row index to designate the header (default first non-empty row) or null for no header", |
There was a problem hiding this comment.
Maybe call it "Excel" row index so people (like me) aren't confused by 0-indexed or 1-indexed, just excel indexed?
| "Specify row index to designate the header (default first non-empty row) or null for no header", | |
| "Specify Excel row index to designate the header (default first non-empty row) or null for no header", |
There was a problem hiding this comment.
It is 0-indexed. I'll clarify that in the text.
There was a problem hiding this comment.
oof, that's a bit confusing since Excel is 1 indexed.
ef955a4 to
379a204
Compare
|
@fdncred The PR should be good to go now. It now sets default names for columns that are missing headers when other columns have headers. |
|
We just need a |
|
Am I right assuming that @fdncred since the defaults change, this probably needs to be marked as a breaking change. |
|
ya, it changes. I just tested it out. I think it's a change for the better, but it is a breaking change. Thanks @weirdan. Before❯ open ~/Desktop/cmds_by_crates_and_tags_long.xlsx | get cmds_by_crates_and_tags_long | first 10
╭─#─┬───────column0────────┬─column1─┬─column2─┬─column3─┬─column4─┬─column5─┬─column6─┬─column7─┬─column8─╮
│ 0 │ name │ crate │ tag │ major │ minor │ patch │ major1 │ minor1 │ patch1 │
│ 1 │ <whitespace? eof> │ crates │ 0.10.0 │ 0 │ 10 │ 0 │ 0 │ 10 │ 0 │
│ 2 │ BackoffColoringMode │ crates │ 0.10.0 │ 0 │ 10 │ 0 │ 0 │ 10 │ 0 │
│ 3 │ SimplestExpression │ crates │ 0.10.0 │ 0 │ 10 │ 0 │ 0 │ 10 │ 0 │
│ 4 │ StringShape │ crates │ 0.10.0 │ 0 │ 10 │ 0 │ 0 │ 10 │ 0 │
│ 5 │ any block │ crates │ 0.10.0 │ 0 │ 10 │ 0 │ 0 │ 10 │ 0 │
│ 6 │ any expression │ crates │ 0.10.0 │ 0 │ 10 │ 0 │ 0 │ 10 │ 0 │
│ 7 │ any expression start │ crates │ 0.10.0 │ 0 │ 10 │ 0 │ 0 │ 10 │ 0 │
│ 8 │ append │ src │ 0.10.0 │ 0 │ 10 │ 0 │ 0 │ 10 │ 0 │
│ 9 │ autoview │ src │ 0.10.0 │ 0 │ 10 │ 0 │ 0 │ 10 │ 0 │
╰─#─┴───────column0────────┴─column1─┴─column2─┴─column3─┴─column4─┴─column5─┴─column6─┴─column7─┴─column8─╯After this PR❯ open ~/Desktop/cmds_by_crates_and_tags_long.xlsx | get cmds_by_crates_and_tags_long | first 10
╭─#─┬─────────name─────────┬─crate──┬──tag───┬─major─┬─minor─┬─patch─┬─major1─┬─minor1─┬─patch1─╮
│ 0 │ <whitespace? eof> │ crates │ 0.10.0 │ 0 │ 10 │ 0 │ 0 │ 10 │ 0 │
│ 1 │ BackoffColoringMode │ crates │ 0.10.0 │ 0 │ 10 │ 0 │ 0 │ 10 │ 0 │
│ 2 │ SimplestExpression │ crates │ 0.10.0 │ 0 │ 10 │ 0 │ 0 │ 10 │ 0 │
│ 3 │ StringShape │ crates │ 0.10.0 │ 0 │ 10 │ 0 │ 0 │ 10 │ 0 │
│ 4 │ any block │ crates │ 0.10.0 │ 0 │ 10 │ 0 │ 0 │ 10 │ 0 │
│ 5 │ any expression │ crates │ 0.10.0 │ 0 │ 10 │ 0 │ 0 │ 10 │ 0 │
│ 6 │ any expression start │ crates │ 0.10.0 │ 0 │ 10 │ 0 │ 0 │ 10 │ 0 │
│ 7 │ append │ src │ 0.10.0 │ 0 │ 10 │ 0 │ 0 │ 10 │ 0 │
│ 8 │ autoview │ src │ 0.10.0 │ 0 │ 10 │ 0 │ 0 │ 10 │ 0 │
│ 9 │ bare expression │ crates │ 0.10.0 │ 0 │ 10 │ 0 │ 0 │ 10 │ 0 │
╰─#─┴─────────name─────────┴─crate──┴──tag───┴─major─┴─minor─┴─patch─┴─major1─┴─minor1─┴─patch1─╯ |
Description
This PR adds the optional flag
--header-rowtofrom xlsxto specify which row should be read in as the column names . By default, the first non-empty row is read in as the header. Specify--header nullfor legacy behavior (no headers are read). See example:User-facing changes (Release notes)
from xlsxnow supports--header-rowfor specifying the 0-indexed index of the row from which to read column names. Default is the first non-empty row, which is a breaking change. Specify--header-row nullfor legacy behavior (i.e., no header).Additional notes
fixes #16114