Conversation
Count only rows which has at least one cell with at least one value.
|
Hmm, this likely has an impact on the benchmarks, see if you can run them, we could provide 2 row counting functions and make them injectable 🤔 countRowsWith (forall m . HexpatEvent -> m Bool) -> ...
countEmptyRows :: HexpatEvent -> m Bool
countEmptyRows = \case { StartElement "row" _ -> True; _ -> False}
countNonEmptyRows :: HexpatEvent -> m Bool
countNonEmptyRows = ... -- your implementationThis way the user could also provide their own favorite row counting mechanism. |
|
@jappeace i have a missing dependency Criterion for some reason when trying to run benchs. Running from nix-shell. Do you know how I can fix that? |
|
a-add criterion |
|
I'm not sure how to run them, I'm getting this error: |
I have added a |
|
yeah, even a small change like that is worth upstreaming in my opinion, I got stuck on that, and I'm used to many tooling issues 😔 |
While I was testing some things around parsing of exhibits, I noticed
that for small
premium-estimatesspreadsheet (8 rows) totalcount declared by
countRowsInSheetis 1990 😨Some templates for unknown for me reasons has a non-empty rows like:
I don't know whether we need to count these rows or not: perhaps we need to add a
countNonEmptyRowsandcountAllRowsfunctions? Please, guide me here if you have your own opinion.For now I changed a function in such way that it counts only rows with at least one cell with value :)
This implementation counts rows correctly (tested it with few templates - but will test more later).
P.S. I also don't know should/can I write any tests for that or not?