Repository navigation
Python: fix: correct WorkflowState fallback expression evaluation (#10612) - #10163
Closed
Patel Namraa (Namraa310806) wants to merge 2 commits into
Closed
Patel Namraa (Namraa310806) wants to merge 2 commits into
Patel Namraa (Namraa310806) wants to merge 2 commits into
Conversation
Patel Namraa (Namraa310806)
temporarily deployed
to
github-app-auth
November 7, 2026 09:12 — with
GitHub Actions
Inactive
Patel Namraa (Namraa310806)
temporarily deployed
to
github-app-auth
November 7, 2026 09:12 — with
GitHub Actions
Inactive
Patel Namraa (Namraa310806)
temporarily deployed
to
github-app-auth
November 8, 2026 07:42 — with
GitHub Actions
Inactive
Member
|
Patel Namraa (@Namraa310806) Thanks for the detailed work and tests. I’m closing this PR because we need to step back and define the fallback contract before expanding it. Matching Power Fx precedence, associativity, grouping, quoting, coercion, functions, and error semantics opens a much larger compatibility surface than this fix suggests. The Python path should provide best-effort behavior when Power Fx is unavailable, not become a second full Power Fx implementation. We’ll use #10162 to decide the supported subset and behavior before accepting another implementation. |
3 tasks done
This branch was previously deployed
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.
Motivation & Context
When the PowerFx engine is unavailable, the standalone Python
WorkflowStateevaluator falls back to_eval_simple().The fallback evaluator produced incorrect results because it split expressions at the first operator occurrence without accounting for operator precedence, associativity, quoted strings, or nested expressions.
Examples reproduced on
main:Local.a Or Local.b And Local.c— incorrect logical precedence.10 - 2 - 3— evaluated as11.0instead of5.100 / 10 / 2— evaluated as20.0instead of5.Local.text = "a And b"— incorrectly interpreted the operator inside the string literal.This change fixes these issues in the standalone
WorkflowStatefallback evaluator.Description & Review Guide
What are the major changes?
What is the impact of these changes?
Expressions evaluated through the Python fallback now produce the expected results for the covered operator combinations. The change is limited to the standalone
WorkflowStatefallback evaluator.What do you want reviewers to focus on?
Related Issue
Fixes #10162
AI Assistance
AI assistance details:
AI was used to polish the issue report and PR description, review the fix for correctness and edge cases, and improve code comments where needed. I reviewed and verified the changes.
Contribution Checklist