Skip to content

acc: python mutator fails on whole-number float variable defaults - #7841

Open
denik wants to merge 1 commit into
mainfrom
denik/acc-pydabs-numeric-variable
Open

denik wants to merge 1 commit into
mainfrom
denik/acc-pydabs-numeric-variable

Conversation

@denik

@denik denik commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Changes

New acceptance test bundle/python/numeric-variable-default. Output records current behavior, no code changes.

Why

With a python: section, a variable default that YAML reads as a whole-number float (1.0, 1e3, 0012345678901234, also inside complex variables) fails every bundle command:

Error: internal error when merging output of Python mutator: unexpected change at "variables.id.default" (update)

The CLI sends the float to Python as a JSON integer, Python returns an int, and the merge reports the kind change. The huge case (a whole float beyond int64) fails differently: Python's output can't be parsed back.

Tests

Only a new test.

This pull request and its description were written by Isaac.

Variable defaults like 1.0, 1e3 or 0012345678901234 are floats in the
config; they reach Python as JSON integers and come back as ints, which
the merge reports as an unexpected change. Output records the error.

Co-authored-by: Isaac <no-reply@databricks.com>
@denik
denik added this pull request to stack #7843 November 20, 2026 09:39
@github-actions github-actions Bot added DABs DABs related issues PyDABs test-only-fix PRs that update failing of flaky tests without changing CLI code. labels Nov 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Commit: c872249df | Workflow run

Regression test report

Selected 1 changed tests (limit=20, 0 not selected)

4 tests: regression=0 unreleased=0 coverage=4 failing=0
test branch main (f4a7fe5) latest (v1.27.0)
TestAccept/bundle/python/numeric-variable-default/DMS=/PYDAB_VERSION=0.266.0 ✅ ✅ ✅
TestAccept/bundle/python/numeric-variable-default/DMS=/PYDAB_VERSION=current ✅ ✅ ✅
TestAccept/bundle/python/numeric-variable-default/DMS=true/PYDAB_VERSION=0.266.0 ✅ ✅ ✅
TestAccept/bundle/python/numeric-variable-default/DMS=true/PYDAB_VERSION=current ✅ ✅ ✅

@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: c872249

Run: 44712625619

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 272 20 3:13
💚​ aws-windows-latest-4core-16gb 1 274 18 4:09
💚​ azure linux-2core-8gb 1 271 20 2:50
💚​ azure-windows-latest-4core-16gb 1 273 18 3:55
💚​ gcp linux-2core-8gb 1 272 20 3:08
💚​ gcp-windows-latest-4core-16gb 1 274 18 3:29
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:54 azure-windows-latest-4core-16gb TestAccept
3:46 aws-windows-latest-4core-16gb TestAccept
3:28 gcp-windows-latest-4core-16gb TestAccept

@denik
denik marked this pull request as ready for review November 20, 2026 12:56
@denik
denik requested review from a team as code owners November 20, 2026 12:56

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated review at c872249. Each finding was verified against the code.

No blocking issues found. 1 non-blocking comment(s) below.

This PR adds a new acceptance test (bundle/python/numeric-variable-default) that documents the current broken behavior when whole-number float variable defaults are round-tripped through the Python mutator. It covers several numeric variants (leading zeros, whole floats, exponents, complex values, and huge numbers) and records the errors in the golden file. No code changes are included. The only concrete issue is a rule violation around test artifact cleanup.

@@ -0,0 +1,4 @@
# The column depends on the size of the Python output, which includes paths.
[[Repls]]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nice to have] The script removes .databricks, __pycache__, and tmp.json with rm -fr (script line 7) instead of declaring them in Ignore. The testing rules require Ignore for test artifacts. Add Ignore = [".databricks", "__pycache__", "tmp.json"] here and drop the rm -fr line from script.

@@ -0,0 +1,4 @@
# The column depends on the size of the Python output, which includes paths.
[[Repls]]
Old = '__generated_by_python__\.yml:\d+:\d+'

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.

This test fails on Windows because the path separator before __generated_by_python__.yml is a backslash there. Could the replacement cover the separator too?

@Sankalp-Mittal Sankalp-Mittal 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.

[AI Generated] Review by review-factory (Claude Opus 5.5 + Claude Fable 5.2, cross-verified). Only points the reviewers agreed on are posted.

@@ -0,0 +1,4 @@
# The column depends on the size of the Python output, which includes paths.
[[Repls]]

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.

[AI Generated] Major: On Windows loadOutput builds this path with filepath.Join, so the huge error reads [TEST_TMP_DIR]\__generated_by_python__.yml and won't match the golden. Can you add the '\\' → / Repl from bundle/validate/yaml_anchors/test.toml?

@@ -0,0 +1,4 @@
# The column depends on the size of the Python output, which includes paths.

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.

[AI Generated] The golden records an internal error as the expected output, but nothing marks it as a bug. Add a Badness = "..." line above [[Repls]], as validate/yaml_duplicate_keys/shadowed_invalid_subtree/test.toml does?

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

DABs DABs related issues PyDABs test-only-fix PRs that update failing of flaky tests without changing CLI code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants