Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Operator + on ranges throws runtime exception AbsoluteCellRange: Wrong range size #1267

Closed
BrianHung opened this issue May 11, 2023 · 2 comments · Fixed by #1311
Closed

Operator + on ranges throws runtime exception AbsoluteCellRange: Wrong range size #1267

BrianHung opened this issue May 11, 2023 · 2 comments · Fixed by #1311
Assignees
Labels
Bug Something isn't working Impact: High Released

Comments

@BrianHung
Copy link
Contributor

Description

Encountered an internal error while trying some array formula tests. The specific formula "='Sheet1'!A:A+'Sheet1'!1:1" I expect to result in a DetailedCellError instead.

import HyperFormula from "hyperformula";

console.log(
  `%c Using HyperFormula ${HyperFormula.version}`,
  "color: blue; font-weight: bold"
);

const hf = HyperFormula.buildFromSheets({
  "Sheet1": [["1"]],
}, {
  licenseKey: "gpl-v3",
  useArrayArithmetic: true,
});

hf.setCellContents({ sheet: 0, row: 0, col: 0 }, "='Sheet1'!A:A+'Sheet1'!1:1")

const sheetName = "Sheet1";
const sheetId = hf.getSheetId(sheetName);

Demo

https://codesandbox.io/s/red-field-hmeldt?file=/src/hyperformulaConfig.js

@BrianHung BrianHung added the Bug Something isn't working label May 11, 2023
@sequba sequba changed the title Error AbsoluteCellRange: Wrong range size with ArrayFormula Operator + on ranges throws runtime exception AbsoluteCellRange: Wrong range size May 30, 2023
@sequba
Copy link
Contributor

sequba commented May 30, 2023

@BrianHung thank you for reporting this issue. You are right, this case should be handled by returning a cell error. We'll work on it in one of the upcoming releases.

@sequba sequba self-assigned this May 30, 2023
@sequba sequba linked a pull request Sep 21, 2023 that will close this issue
15 tasks
sequba added a commit that referenced this issue Sep 23, 2023
sequba added a commit that referenced this issue Sep 26, 2023
…#1311)

* Return a cell error instead of throwing an exception on invalid range size

* Make ParsingError message more detailed

* Add changelog entry

* Modified toEqualErrorMatcher test helper to be less strict about matching the error message

* Add unit tests for issue #1267

* Fix some linter warnings
@AMBudnik
Copy link
Contributor

Hi @BrianHung

I have good news! We're closing this issue as solved and released in HyperFormula 2.6.1.
Here's a list of all the changes https://github.com/handsontable/hyperformula/releases/tag/2.6.1

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug Something isn't working Impact: High Released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants