inputs icon indicating copy to clipboard operation
inputs copied to clipboard

Search should not alter `columns`

Open mootari opened this issue 3 years ago • 1 comments

Inputs.search accepts the columns option to restrict filtering to a subset of columns. However, doing so also sets the .columns property on the dataset. Downstream cells that display the data via Inputs.table() will only show the filtered columns, unless the columns option is passed in explicitely.

Repro

Create a notebook with the following three cells:

data = [{foo: 1, bar: 'a'}, {foo: 2, bar: 'b'}, {foo: 3, bar: 'c'}]
viewof results = Inputs.search(data, {columns: ['foo']})
Inputs.table(results)

Notice how the table only displays the column "foo".

Screenshot

image

mootari avatar Oct 30 '22 09:10 mootari

I found the same error. I think it can easily be fixed by changing the columns option to column

mtthsdzwn avatar Dec 13 '23 09:12 mtthsdzwn