Skip to content

Fix(Evaluator): Coalesce null values in arithmetic functions#81

Open
arnaudfnr wants to merge 5 commits into
mainfrom
arnaudfnr/fix-null-values-in-formulas
Open

Fix(Evaluator): Coalesce null values in arithmetic functions#81
arnaudfnr wants to merge 5 commits into
mainfrom
arnaudfnr/fix-null-values-in-formulas

Conversation

@arnaudfnr
Copy link
Copy Markdown
Collaborator

No description provided.

@arnaudfnr arnaudfnr requested a review from Cabanon April 29, 2026 08:58
@arnaudfnr arnaudfnr linked an issue Apr 29, 2026 that may be closed by this pull request
@arnaudfnr arnaudfnr self-assigned this Apr 29, 2026
Comment thread coordo-py/coordo/sql/evaluator.py Outdated
expr = coalesce(lhs.expr, 0) - coalesce(rhs.expr, 0)
case "/":
expr = lhs.expr / rhs.expr
expr = coalesce(lhs.expr, 0) / coalesce(rhs.expr, 0)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

division par 0 pas ouf il faut que tu fasses un case pour que ce soit null en cas de division par 0

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok j'ajoute un case

Comment thread coordo-py/coordo/sql/evaluator.py Outdated
expr = coalesce(lhs.expr, 0) / coalesce(rhs.expr, 0)
case "*":
expr = lhs.expr * rhs.expr
expr = coalesce(lhs.expr, 0) * coalesce(rhs.expr, 0)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on veut vraiment qu'une multiplication par null fasse 0 ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je remplace par 1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

en fait j'en sais rien, peut-être que 0 c'est bien

Comment thread coordo-py/coordo/sql/evaluator.py Outdated
expr = coalesce(lhs.expr, 0) * coalesce(rhs.expr, 0)
case "^":
expr = func.pow(lhs.expr, rhs.expr)
expr = func.pow(coalesce(lhs.expr, 0), coalesce(rhs.expr, 1))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

même question

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pour la puissance null² = 0 pour moi

Copy link
Copy Markdown
Collaborator

@Cabanon Cabanon Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

En fait j'ai un doute sur le fait qu'on devrait toucher au power, autant division et multiplication c'est intuitif autant le power peut-être qu'il faut laisser fail

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

Successfully merging this pull request may close these issues.

Bug: Null number values shoudl be considered as 0 in sums

2 participants