[19.0][FIX] mis_builder: don't report unresolvable styles on intermediate passes - #830
Open
MiquelRForgeFlow wants to merge 2 commits into
Open
[19.0][FIX] mis_builder: don't report unresolvable styles on intermediate passes#830MiquelRForgeFlow wants to merge 2 commits into
MiquelRForgeFlow wants to merge 2 commits into
Conversation
Cover the evaluation of the style_expression of a mis.report.kpi: the style of a kpi requeued for recomputation, an expression that cannot be evaluated, and one naming a style that does not exist. The three tests fail on this commit.
Contributor
|
Hi @sbidoul, |
…asses A requeued kpi is set in the matrix with an incomplete locals_dict, so its style_expression fails and the resulting DataError, being truthy, was logged as "Style '' not found." once per pass. Skip the evaluation when the cell value is in error, and report a failing expression with its real message.
MiquelRForgeFlow
force-pushed
the
19.0-fix-mis_builder-unresolvable-styles
branch
from
September 10, 2026 16:47
e6f6c89 to
82e86d4
Compare
This file contains hidden or 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
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
KpiMatrix.set_values_detail_accountis called on every pass of the computation loop, including the passes where a KPI is requeued because its expression referenced a KPI that was not evaluated yet. On those passeslocals_dictis incomplete, so astyle_expressionreferring to the KPI's own value fails andmis_safe_evalreturns aDataError.DataErrorsubclassesException, so it is truthy and renders as an empty string. It was therefore passed to the style search and logged asStyle '' not found.once per intermediate pass. That is noise on a perfectly correct report, and it hides the real problem when a style expression is actually broken:The style evaluation is now skipped when the cell value is itself in error, since that error is already reported in the cell, and a
DataErrorcoming from the style expression is reported with its actual message.style_nameis also initialised, as it was left unbound ifmis_safe_evalever raised.No preliminary issue was opened, as the change is small and self-contained.
Test
mis_builder/tests/test_style_expression.pyis added in a separate commit (e6dd781) so the bug can be reproduced before the fix. On that commit the three tests fail:With the fix applied the full module suite is green (122 tests, 0 failed).
Target branch
19.0, where the bug is. The "Target branch" section of the PR template is out of date: it still refers to versions 9 to 12 and asks to target 10.0.
CLA
Signed.
Changelog entry
mis_builder/readme/newsfragments/830.bugfix, included in the fix commit.