handsontable / hyperformula

HyperFormula is an open-source headless spreadsheet for business web apps. It comes with over 400 formulas, CRUD operations, undo-redo, clipboard support, and sorting.
https://hyperformula.handsontable.com/
Other
1.97k stars 108 forks source link

Return a `CellError` when operating on ranges with incompatible sizes #1311

Closed sequba closed 1 year ago

sequba commented 1 year ago

Context

Before this PR, a range with invalid size resulted in a runtime exception. We decided that in such a case, we should return a CellError instead.

How did you test your changes?

Types of changes

Related issues:

Fixes #1267

Checklist:

github-actions[bot] commented 1 year ago

Performance comparison of head (5ced108c2d8924c5b55bf489fc54aa7b84eb6dd5) vs base (c14a21cc2b82b771569744cbcdeedf48fc8f75c1)

                                     testName |   base |   head |  change
-------------------------------------------------------------------------
                                      Sheet A | 720.83 | 720.63 |  -0.03%
                                      Sheet B |  235.6 | 238.81 |  +1.36%
                                      Sheet T | 211.02 | 211.49 |  +0.22%
                                Column ranges | 798.56 | 800.32 |  +0.22%
Sheet A:  change value, add/remove row/column |     52 |     51 |  -1.92%
 Sheet B: change value, add/remove row/column |    424 |    372 | -12.26%
                   Column ranges - add column |    212 |    400 | +88.68%
                Column ranges - without batch |    811 |    608 | -25.03%
                        Column ranges - batch |    135 |    142 |  +5.19%
codecov[bot] commented 1 year ago

Codecov Report

Merging #1311 (5ced108) into develop (c14a21c) will increase coverage by 0.02%. The diff coverage is 97.14%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1311      +/-   ##
===========================================
+ Coverage    97.25%   97.27%   +0.02%     
===========================================
  Files          169      169              
  Lines        14408    14420      +12     
  Branches      3076     3080       +4     
===========================================
+ Hits         14012    14027      +15     
+ Misses         391      388       -3     
  Partials         5        5              
Files Coverage Δ
src/Cell.ts 94.39% <100.00%> (+1.93%) :arrow_up:
src/DependencyGraph/ParsingErrorVertex.ts 100.00% <100.00%> (ø)
src/parser/Ast.ts 98.26% <100.00%> (+0.01%) :arrow_up:
src/Operations.ts 99.08% <95.83%> (-0.18%) :arrow_down:

... and 1 file with indirect coverage changes