-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IMP] compiler #4088
Closed
Closed
[IMP] compiler #4088
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LucasLefevre
force-pushed
the
master-reffn-single-cells-lul
branch
4 times, most recently
from
April 17, 2024 08:50
5409498
to
dcb43e9
Compare
laa-odoo
approved these changes
Apr 18, 2024
LucasLefevre
force-pushed
the
master-reffn-single-cells-lul
branch
3 times, most recently
from
April 18, 2024 14:38
f875643
to
038cf74
Compare
laa-odoo
force-pushed
the
master-reffn-single-cells-lul
branch
from
April 19, 2024 12:48
038cf74
to
4865a88
Compare
LucasLefevre
commented
Apr 23, 2024
src/plugins/ui_core_views/cell_evaluation/compilation_parameters.ts
Outdated
Show resolved
Hide resolved
Steps to reproduce: - type in a cell `=IFERROR(ADD(A1:A2,1),456)` => the cell value is #ERROR instead of 456. The compiled formulas use to functions to get the values of references - `ref` returns a single value from a single cell - `range` returns a matrix of values Currently, the compiler chooses `ref` or `range` based on the function arg. e.g. for 'ADD(..., ...)', the compiler would choose `ref` because ADD only accepts single cell values. If the user typed `ADD(A1:A3, 2)`, `ref` currently checks the range size and throw an error if it's not a single cell. That causes the entire compiled function to fail. Notably: '=IFERROR(ADD(A1:A2,1), 45)' results in an error instead of 45. One key observation is that `ref` is actually useless from a functional POV. We could always use `range` no matter the shape of the arguments. There's already a check for the input sizes for each sub-function (think of 'ADD(TRANSPOSE(...), 5)'. There is a performance issue though because `range` always builds a 2D matrix. A POC was done to remove `ref` entirely and only use `range` but it showed 2x increase of the evaluation time of the large formula dataset. With this commit, we keep `ref` and use it every time the reference is a single cell, and (importantly) only in this case. The logic of errors =================== There are two types of errors in formulas: - structural/compilation errors: If the formula will *never* be correct, no matter what changes in the spreadsheet, for example `=TODAY(456)` will never work because `TODAY` will never accept any argument. Those errors cannot be caught by IFERROR for a functional reason: warn the user the formula is wrong (and will always be) and that he should fix it. - evaluation errors: Any other error (divisiion by zero, wrong type). They can be caught by IFERROR. In the context of this PR: `ADD(A1:A2,1)` is invalid because `ADD` does not accepts ranges. But it can become valid if row 2 is deleted. Task: 3859327 Co-authored-by: Alexis Lacroix <[email protected]>
Steps to reproduce: - make sure no sheet is named qsqdfq - type in a cell: `=IFERROR(qsqdfq!A1, 45)` => the cell value is #ERROR instead of 45 Task: 3597039
rrahir
force-pushed
the
master-reffn-single-cells-lul
branch
from
April 23, 2024 07:46
4865a88
to
768db7c
Compare
@robodoo r+ |
robodoo rebase-ff :) |
Merge method set to rebase and fast-forward. |
robodoo
pushed a commit
that referenced
this pull request
Apr 23, 2024
Steps to reproduce: - type in a cell `=IFERROR(ADD(A1:A2,1),456)` => the cell value is #ERROR instead of 456. The compiled formulas use to functions to get the values of references - `ref` returns a single value from a single cell - `range` returns a matrix of values Currently, the compiler chooses `ref` or `range` based on the function arg. e.g. for 'ADD(..., ...)', the compiler would choose `ref` because ADD only accepts single cell values. If the user typed `ADD(A1:A3, 2)`, `ref` currently checks the range size and throw an error if it's not a single cell. That causes the entire compiled function to fail. Notably: '=IFERROR(ADD(A1:A2,1), 45)' results in an error instead of 45. One key observation is that `ref` is actually useless from a functional POV. We could always use `range` no matter the shape of the arguments. There's already a check for the input sizes for each sub-function (think of 'ADD(TRANSPOSE(...), 5)'. There is a performance issue though because `range` always builds a 2D matrix. A POC was done to remove `ref` entirely and only use `range` but it showed 2x increase of the evaluation time of the large formula dataset. With this commit, we keep `ref` and use it every time the reference is a single cell, and (importantly) only in this case. The logic of errors =================== There are two types of errors in formulas: - structural/compilation errors: If the formula will *never* be correct, no matter what changes in the spreadsheet, for example `=TODAY(456)` will never work because `TODAY` will never accept any argument. Those errors cannot be caught by IFERROR for a functional reason: warn the user the formula is wrong (and will always be) and that he should fix it. - evaluation errors: Any other error (divisiion by zero, wrong type). They can be caught by IFERROR. In the context of this PR: `ADD(A1:A2,1)` is invalid because `ADD` does not accepts ranges. But it can become valid if row 2 is deleted. Task: 3859327 Part-of: #4088 Co-authored-by: Alexis Lacroix <[email protected]>
robodoo
pushed a commit
that referenced
this pull request
Apr 23, 2024
Steps to reproduce: - make sure no sheet is named qsqdfq - type in a cell: `=IFERROR(qsqdfq!A1, 45)` => the cell value is #ERROR instead of 45 closes #4088 Task: 3597039 Signed-off-by: Rémi Rahir (rar) <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
description of this task, what is implemented and why it is implemented that way.
Task: : TASK_ID
review checklist