feat: accept optional column argument for grid command#18187
Conversation
| or record, it determines what to put in the grid by looking for a | ||
| column named 'name'. This is subject to change in the future." | ||
| "The `grid` command creates a concise gridded layout for the input. It | ||
| prints every item of the list in a grid layout. However, for table, |
There was a problem hiding this comment.
| prints every item of the list in a grid layout. However, for table, | |
| prints every item of the list in a grid layout. However, for table or record input, |
There was a problem hiding this comment.
I intentionally left out record as column name doesn't work for it.
There was a problem hiding this comment.
why not? didn't it work in the past?
There was a problem hiding this comment.
For the same reason grid doesn't accept any (string, int, bool, etc). It doesn't make sense for a scalar value to be put in a grid.
There was a problem hiding this comment.
so, technically, it is a breaking change because you're removing this functionality. it's just that it's probably not used. As long as a list of records and tables work, it's probably fine.
There was a problem hiding this comment.
I am not removing any functionality in this pr. They are just being deprecated. But yes, when they will eventually be removed, it will be breaking.
|
Btw, i don't think it should be Also |
|
Thanks |
Description
The
gridcommand is hardcoded to always look fornamecolumn. This pr attempts to solve this issue by accepting an additional column parameter.Also,
gridcommand used to returnnothinginstead of string if the input was an empty list, it is now resolved.User-facing changes (Release notes)
The
gridcommand now accepts an optional column name to display the contents of that column in a grid. One should no longer rely on the old behavior which automatically displays thenamecolumn as it is deprecated. Moreover, passing in a record as the input is also deprecated.Additional notes
N/A