Skip to content

Fix default scalar values in command output - #305

Open
RKS (rksharma-owg) wants to merge 1 commit into
microsoft:devfrom
rksharma-owg:fix/preserve-default-scalar-output
Open

Fix default scalar values in command output#305
RKS (rksharma-owg) wants to merge 1 commit into
microsoft:devfrom
rksharma-owg:fix/preserve-default-scalar-output

Conversation

@rksharma-owg

Copy link
Copy Markdown

Default integer and string command arguments currently become {"isDefault": true} in output. todict reads the marker classes' __dict__, losing the value the command returned.

Convert DefaultInt and DefaultStr to their built-in scalar types before object conversion. Regression coverage checks direct and nested results, built-in output types, and retention of the original default marker.

Fixes #215.

Validation on macOS, Python 3.12.13:

  • The new regression fails for both default types before the fix.
  • pytest: 246 passed, 2 subtests passed.
  • License verification, flake8, and all 3 example tests pass.
  • Pylint reports E1120 in unchanged knack/_win_vt.py:40; it also reproduces when linting that unchanged module alone.

AI assistance: Codex assisted with investigation, implementation, and local verification.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

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.

util.todict process DefaultInt to a dictionary instead of a int

1 participant