Skip to content

Python: Preserve falsey EditTableV2 items - #7380

Draft
hsusul wants to merge 1 commit into
microsoft:mainfrom
hsusul:fix-python-declarative-falsy-edit-table-item
Draft

Python: Preserve falsey EditTableV2 items#7380
hsusul wants to merge 1 commit into
microsoft:mainfrom
hsusul:fix-python-declarative-falsy-edit-table-item

Conversation

@hsusul

@hsusul hsusul commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Motivation & Context

EditTableV2 accepts YAML/JSON values through its item field, including valid falsey values such as false, 0, an empty string, an empty list, or an empty object. The Python executor currently selects item with a truthiness fallback, so adding any of those values stores the legacy value field instead (or None when value is absent). For example, adding item: false to [true] deterministically produces [true, null] instead of [true, false], corrupting the workflow table value.

Description & Review Guide

  • What are the major changes? Replace the truthiness fallback with an explicit None check, and add regression coverage for False, 0, "", [], and {} plus boundary coverage that preserves the existing legacy value fallback when item is None. Local checks passed: uv run poe test -P declarative (686 passed, 254 skipped), uv run poe syntax -P declarative (2 tasks passed), uv run poe pyright -P declarative (0 errors), uv run poe check (all syntax, source typing, test typing, package tests, and Markdown code checks passed with exit 0), and git diff --check.
  • What is the impact of these changes? Falsey table items retain their value and type. None continues to act as the missing-item sentinel for compatibility with the legacy value field. There are no public API, schema, provider, or unrelated operation changes.
  • What do you want reviewers to focus on? The distinction between a present falsey item and the existing None fallback behavior.

Related Issue

Fixes #7379

No other open pull request for #7379 was found during the duplicate check.

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 title prefix in sync automatically.

Copilot AI review requested due to automatic review settings July 29, 2026 05:08
@hsusul
hsusul temporarily deployed to github-app-auth July 29, 2026 05:08 — with GitHub Actions Inactive
@hsusul
hsusul temporarily deployed to github-app-auth July 29, 2026 05:08 — with GitHub Actions Inactive
@hsusul
hsusul temporarily deployed to github-app-auth July 29, 2026 05:08 — with GitHub Actions Inactive
@agent-framework-automation agent-framework-automation Bot added the python Usage: [Issues, PRs], Target: Python label Jul 29, 2026
@hsusul
hsusul temporarily deployed to github-app-auth July 29, 2026 05:08 — with GitHub Actions Inactive

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.

Pull request overview

This PR fixes a Python declarative workflow bug where EditTableV2 incorrectly treated valid falsey item values (False, 0, "", [], {}) as “missing” due to a truthiness-based fallback, causing the executor to instead use the legacy value field (or None) and corrupt table contents.

Changes:

  • Update EditTableV2Executor to select item via an explicit None check, preserving falsey values while keeping the legacy value fallback when item is None.
  • Add regression tests covering falsey item values and a boundary test confirming the legacy value fallback remains when item is None.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
python/packages/declarative/agent_framework_declarative/_workflows/_executors_basic.py Replace truthiness fallback with an explicit None check so falsey item values are preserved.
python/packages/declarative/tests/test_graph_executors.py Add regression/boundary tests ensuring falsey item values are retained and legacy value fallback still works when item is None.

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.

.NET: Python: [Bug]: EditTableV2 replaces falsey item values with None

2 participants