Skip to content
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

Division by Zero error in solve on IF() function not being rescued #301

Open
gerardtan2018 opened this issue Feb 16, 2024 · 0 comments
Open

Comments

@gerardtan2018
Copy link

gerardtan2018 commented Feb 16, 2024

When using the IF function, when the function is expressed this way IF(5 / 0 > 0, 100, 1000), ZeroDivisionError will be thrown due to predicate.value(context) here when trying to retrieve the dependencies.

This is not rescued by BulkExpressionSolver's with_rescued as the trigger line is in line 72 (variables_in_resolve_order) here, where the function is only trying to find_resolve_order

There was an issue in Dentaku repo that mentions the division by zero error on variable evaluation, and it might be possible that this was missed while addressing that issue, since there are 2 places where evaluation happens: 1 in the main block, the other hiding within the retrieval of dependencies of IF.

There was a commit where the short-circuit was added here which is causing the issue I am facing now. Is this short-circuit added to make the code more efficient?

Thanks you!
Gerard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant