From f069b689e630e3e6b545be5e4550608321d594ad Mon Sep 17 00:00:00 2001 From: ovidijg Date: Fri, 5 Apr 2024 10:58:30 +0300 Subject: [PATCH] forgot tqdm :) --- nimlite/funcs/groupby.nim | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/nimlite/funcs/groupby.nim b/nimlite/funcs/groupby.nim index 4d750d74..d52bd703 100644 --- a/nimlite/funcs/groupby.nim +++ b/nimlite/funcs/groupby.nim @@ -642,11 +642,7 @@ proc groupby*(T: nimpy.PyObject, keys: seq[string], functions: seq[(string, Accu var columnsPaths: OrderedTable[string, seq[string]] = collect(initOrderedTable()): for cn in columnNames: {cn: tabliteBase.collectPages(T[cn])} - - for cn in columnNames: - var pages: seq[string] = tabliteBase.collectPages(T[cn]) - columnsPaths[cn] = pages - + var pbar = tqdm!(desc: &"groupby", total: len(columnsPaths[toSeq(columnsPaths.keys)[0]])) var aggregationFuncs = initOrderedTable[seq[PY_ObjectND], seq[(string, GroupByFunction)]]() for pagesZipped in pageZipper(columnsPaths): for row in iteratePages(pagesZipped): @@ -666,6 +662,7 @@ proc groupby*(T: nimpy.PyObject, keys: seq[string], functions: seq[(string, Accu aggFuncs = aggregationFuncs[key] for (cn, fun) in aggFuncs: fun.update(some(d[cn])) + discard pbar.update(1) var keysFuncCols = keys for (cn, acc) in functions: @@ -692,7 +689,7 @@ proc groupby*(T: nimpy.PyObject, keys: seq[string], functions: seq[(string, Accu for p in pages: discard column.pages.append(p) newTable[cn] = column - + discard pbar.close() return newTable # when appType != "lib":