Add a dont_fetch query parameter

The new fetch_only argument to searches is wonderful! Can we also get its inverse?

Most of the time I use fetch_only, what I really want is to EXCLUDE a column, vs selecting the columns I want.

I can do something like:

dont_fetch = ['some_column']
columns = [c['name'] for c in my_table.list_columns() if c['name'] not in dont_fetch]
my_results = my_tables.search(q.fetch_only(*columns))

But I’d like to be able to just do:

dont_fetch = ['some_column']
my_results = my_tables.search(q.dont_fetch(*dont_fetch))
4 Likes

+1 For the feature request.

This did come up before, but if it was a feature using the code would be less clunky that the solution we came up with.

The ‘clunky’ part of this solution is you have to pass in the table object or name of the table to the function, but other than that, its the same as the solution you already use.

3 Likes