Skip to content

FIX: Show an explicit empty converted value in the HTML scenario report - #3771

Open
KVR Vishnu (VISHNU0906) wants to merge 1 commit into
microsoft:mainfrom
VISHNU0906:fix-html-empty-converted-value
Open

KVR Vishnu (VISHNU0906) wants to merge 1 commit into
microsoft:mainfrom
VISHNU0906:fix-html-empty-converted-value

Conversation

@VISHNU0906

Copy link
Copy Markdown

Description

Fixes #3741.

The HTML scenario report chose what to show with converted_value or original_value. When a converter intentionally produces an empty string, that check treats it as missing and shows the original text instead, so the report shows something that was never sent to the target. The same pattern was used for media pieces.

This change picks the shown value once per piece and only falls back to the original value when the converted value is missing or None. An empty string is now shown as empty, in both the text and media branches. Nothing else in the template changes.

cc Roman Lutz (@romanlutz) (issue author) and Justin Song (@jsong468) (added the HTML printer). Happy to adjust anything.

I used an AI assistant to help find and write this change. I read every changed line and ran the tests myself.

Tests and Documentation

Added three tests in tests/unit/output/scenario_result/test_html.py:

  • explicit empty converted text is rendered as empty and the original text does not appear
  • explicit empty converted media is rendered as [image_path] with no original path
  • the original value is still shown when converted_value is None or missing

The two empty-value tests fail on main and pass with the fix. Locally:

  • pytest tests/unit/output: 395 passed
  • full unit suite (pytest -n 4 --dist=loadfile tests/unit): 32112 passed, 476 skipped
  • ruff check and ruff format --check clean on the changed files

No documentation changes needed, and no notebooks were touched.

The HTML report picked the shown text with 'converted_value or
original_value', so an intentionally empty conversion fell back to the
original text and the report showed something that was never sent.
Fall back to the original only when the converted value is missing or
None, and add tests for empty text, empty media and the fallback.

Fixes microsoft#3741

Signed-off-by: KVR Vishnu <46535652+VISHNU0906@users.noreply.github.com>
@VISHNU0906

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

This branch has not been deployed

No deployments
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.

HTML scenario export replaces an intentionally empty converted message with the original text

1 participant