arquero icon indicating copy to clipboard operation
arquero copied to clipboard

table.print() should return table to enable chaining

Open mhkeller opened this issue 1 year ago • 0 comments

Currently if you do:

table
  .select('col1', 'col2', 'col3')
  .print()

You'll see your table in the console. But you can't continue chaining operations. This would be useful to check on the result of an operation before continuing onto the next like so.

table
  .select('col1', 'col2', 'col3')
  .print()
  .groupBy('col1')
  .pivot('col2', 'col3')
  .print()

I haven't studied the source code too in-depth but something like return this at the end of this function would work: https://github.com/uwdata/arquero/blob/d1721929c64fafdaa3e40ff24ed14993fb7cf417/src/table/table.js#L289

mhkeller avatar Aug 05 '22 19:08 mhkeller

That seems reasonable to me! Added in #289.

jheer avatar Aug 12 '22 12:08 jheer

Thanks!

mhkeller avatar Aug 12 '22 13:08 mhkeller