Skip to content

Python: Fix quoted arguments in declarative concatenation - #9073

Open
LI (ktz03) wants to merge 1 commit into
microsoft:mainfrom
ktz03:fix/declarative-concat-arguments
Open

LI (ktz03) wants to merge 1 commit into
microsoft:mainfrom
ktz03:fix/declarative-concat-arguments

Conversation

@ktz03

Copy link
Copy Markdown
Contributor

Motivation & Context

Declarative string concatenation currently treats any argument beginning and ending with a double quote as a literal. Concatenate("a" & "b", "c") consequently emits a" & "bc instead of abc, and Concatenate("a""b", "c") leaves the escaped quote doubled. This can put formula source into a workflow's rendered activity.

Description & Review Guide

  • What are the major changes? Recognize a complete double-quoted literal and decode PowerFx's doubled quotes. Evaluate compound arguments through the existing expression path. The string Concat alias and existing single-quoted compatibility path are preserved.
  • What is the impact of these changes? Valid expressions and quoted text render correctly while literal-only concatenation still works without the PowerFx engine. The 38 new regression cases cover factory-created workflows and the engine-unavailable path: 14 fail and 24 pass before the fix, then all 38 pass. The full declarative package passes 1,385 tests with 93% coverage on Windows/Python 3.12.14 with PowerFx 0.0.34. Ruff, source Pyright, all five configured test type checkers, applicable pre-commit hooks, and wheel/sdist builds pass. These are local checks; no external model or deployed service was exercised.
  • What do you want reviewers to focus on? Literal recognition, escaped-quote decoding, and preservation of nested expressions, MessageText, missing-value handling, and the engine-independent literal path.

Related Issue

Fixes #9072

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and the title prefix in sync automatically.

@ktz03
LI (ktz03) deployed to github-app-auth October 5, 2026 17:53 — with GitHub Actions Active
Copilot AI balanced review requested due to automatic review settings October 5, 2026 17:53
@ktz03
LI (ktz03) deployed to github-app-auth October 5, 2026 17:53 — with GitHub Actions Active
@agent-framework-automation agent-framework-automation Bot added the python Usage: [Issues, PRs], Target: Python label Oct 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The focused implementation correctly addresses the reported cases with comprehensive regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes declarative concatenation so complete PowerFx string literals are decoded correctly while compound expressions are evaluated normally.

Changes:

  • Recognizes complete quoted literals and decodes doubled quotes.
  • Adds workflow and engine-unavailable regression coverage for both aliases.
File Description
_declarative_base.py Corrects concatenation argument evaluation.
test_graph_workflow_integration.py Adds workflow-level regression cases.
test_graph_executors.py Verifies literal concatenation without PowerFx.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

This branch was successfully deployed

1 active deployment
github-app-auth — 8b3634ae Deployed Oct 9, 2026 by ktz03 via team_check #6416
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: Declarative concatenation treats quoted expressions as literal text

2 participants