Skip to content

acc: add tests for unquoted numeric YAML values in string fields - #7811

Open
denik wants to merge 2 commits into
mainfrom
denik/acc-yaml-numeric-strings
Open

denik wants to merge 2 commits into
mainfrom
denik/acc-yaml-numeric-strings

Conversation

@denik

@denik denik commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Changes

New acceptance tests bundle/validate/yaml_numeric_strings and bundle/validate/variables/numeric_defaults. Outputs record current behavior, no code changes.

Why

Follow-up to #7793. An unquoted value that YAML resolves to a number is converted back to a string in string fields, and the source text is lost: 0042 → 42, 1.10 → 1.1, 1e3 → 1000, 0x1F → 31, True → true, git_commit 1234e56 → 60 digits, ids with a leading zero lose it. Variable defaults keep the number type, so ${var.x} loses the text the same way. On top of that, id-${var.x} with default 0012345678901234 gives id-1.2345678901234e+13: yaml.v3 resolves leading-zero values containing 8/9 as floats, and interpolation formats them with fmt.Sprint. Values from --var and BUNDLE_VAR_* are strings and are kept as-is.

Tests

Only new tests.

This pull request and its description were written by Isaac.

@denik
denik requested review from a team as code owners November 19, 2026 14:34
@github-actions github-actions Bot added DABs DABs related issues test-only-fix PRs that update failing of flaky tests without changing CLI code. labels Nov 19, 2026
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Commit: 58980cea9 | Workflow run

Regression test report

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

4 tests: regression=0 unreleased=0 coverage=4 failing=0
test branch main (828e0b1) latest (v1.27.0)
TestAccept/bundle/validate/variables/numeric_defaults/DMS= ✅ ✅ ✅
TestAccept/bundle/validate/variables/numeric_defaults/DMS=true ✅ ✅ ✅
TestAccept/bundle/validate/yaml_numeric_strings/DMS= ✅ ✅ ✅
TestAccept/bundle/validate/yaml_numeric_strings/DMS=true ✅ ✅ ✅

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

Looks good to me — no issues found.

@denik
denik enabled stacked auto-merge November 19, 2026 14:45
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 58980ce

Run: 44557675591

Env 🔄​flaky 💚​RECOVERED ✅​pass 🙈​skip Time
🔄​ aws linux-2core-8gb 1 1 271 21 22:08
💚​ aws-windows-latest-4core-16gb 1 274 19 10:00
💚​ azure linux-2core-8gb 1 271 21 16:59
💚​ azure-windows-latest-4core-16gb 1 273 19 16:37
💚​ gcp linux-2core-8gb 1 272 21 16:34
💚​ gcp-windows-latest-4core-16gb 1 274 19 13:35
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
🔄​ TestExportDir 🔄​f ✅​p ✅​p ✅​p ✅​p ✅​p
Top 48 slowest tests (at least 2 minutes):
duration env testname
7:46 azure-windows-latest-4core-16gb TestImportDirWithOverwriteFlag
5:39 azure-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsStat
5:34 aws linux-2core-8gb TestFilerWorkspaceFilesExtensionsRead
5:30 azure linux-2core-8gb TestFilerWorkspaceFilesExtensionsReadDir
5:07 azure-windows-latest-4core-16gb TestFilerRecursiveDelete/workspace_files
4:50 gcp-windows-latest-4core-16gb TestFilerReadWrite/workspace_files
4:21 gcp linux-2core-8gb TestFilerRecursiveDelete/workspace_files_extensions
4:14 gcp linux-2core-8gb TestFilerWorkspaceFilesExtensionsReadDir
4:07 aws-windows-latest-4core-16gb TestAccept
4:03 aws linux-2core-8gb TestFilerWorkspaceFilesExtensionsReadDir
3:53 aws linux-2core-8gb TestFilerWorkspaceFilesExtensionsStat
3:51 gcp linux-2core-8gb TestExportDir
3:40 aws linux-2core-8gb TestSyncFullFileSync
3:34 aws linux-2core-8gb TestFilerReadWrite/workspace_files_extensions
3:30 gcp-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsReadDir
3:30 gcp-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsDelete
3:23 aws-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsReadDir
3:21 aws linux-2core-8gb TestFilerRecursiveDelete/workspace_files_extensions
3:13 gcp-windows-latest-4core-16gb TestAccept
3:11 azure-windows-latest-4core-16gb TestAccept
2:55 azure linux-2core-8gb TestImportDirDoesNotOverwrite
2:47 azure linux-2core-8gb TestFilerWorkspaceFilesExtensionsStat
2:47 aws-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsStat
2:46 aws-windows-latest-4core-16gb TestExportDir
2:43 azure-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsRead
2:38 aws-windows-latest-4core-16gb TestSyncIncrementalFileSync
2:36 aws linux-2core-8gb TestImportDir
2:29 azure linux-2core-8gb TestFilerReadWrite/workspace_files_extensions
2:29 gcp-windows-latest-4core-16gb TestSyncIncrementalSyncPythonNotebookToFile
2:28 gcp linux-2core-8gb TestImportDirWithOverwriteFlag
2:28 azure-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsReadDir
2:25 azure-windows-latest-4core-16gb TestImportDirDoesNotOverwrite
2:22 gcp linux-2core-8gb TestFilerRecursiveDelete/workspace_files
2:21 azure linux-2core-8gb TestFilerReadDir/workspace_files_extensions
2:19 azure linux-2core-8gb TestImportDirWithOverwriteFlag
2:18 aws linux-2core-8gb TestFilerReadDir/workspace_files
2:18 azure-windows-latest-4core-16gb TestImportDir
2:13 gcp-windows-latest-4core-16gb TestWorkpaceExportPrintsContents
2:13 gcp-windows-latest-4core-16gb TestFilerRecursiveDelete/workspace_files_extensions
2:10 aws-windows-latest-4core-16gb TestImportDirWithOverwriteFlag
2:09 azure linux-2core-8gb TestLock
2:07 azure-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsDelete
2:07 gcp-windows-latest-4core-16gb TestImportDirDoesNotOverwrite
2:05 gcp linux-2core-8gb TestFilerWorkspaceFilesExtensionsDelete
2:05 aws-windows-latest-4core-16gb TestFilerReadWrite/workspace_files_extensions
2:04 aws linux-2core-8gb TestImportDirDoesNotOverwrite
2:04 gcp linux-2core-8gb TestAccept
2:04 azure-windows-latest-4core-16gb TestTelemetryEndpoint

@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 Fable 5.2 + Claude Opus 5.5, cross-verified). Only points the reviewers agreed on are posted.

No blocking or major issues found.

from_flag: ${var.from_flag}
from_env: ${var.from_env}
leading_zero_int: ${var.leading_zero_int}
interpolated: id-${var.leading_zero}

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] id-${var.leading_zero} renders as id-1.2345678901234e+13, while the pure reference gives 12345678901234. If that's a bug, can a test.toml Badness line record it, like target_timestamp_shorthand does?

@@ -0,0 +1,100 @@
# Unquoted scalars that YAML resolves to a number, bool or timestamp, used in
# string-typed fields. Each value is written twice: unquoted and quoted ("q_").

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] nit: Only tags and base_parameters have q_ pairs; name, parameters, git_commit, the ids and the pipeline fields are written once, unquoted. Can the header say that instead of "each value is written twice"?

name: numeric-defaults

variables:
# YAML resolves this to a float: with a leading "0" it is not a valid octal int (has 8, 9).

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] nit: The float comes from yaml.v3, not YAML: the 1.2 core schema reads 0012345678901234 as an int and PyYAML keeps it a string. Can this say "yaml.v3 resolves"?

denik and others added 2 commits November 19, 2026 15:36
Cover fields that hold ids, versions and tags, both as literals and via
${var.x}. Outputs record the current lossy conversion (leading zeros,
trailing zeros, exponents, hex/octal, interpolated floats).

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
@denik
denik force-pushed the denik/acc-yaml-numeric-strings branch from 3178a31 to 58980ce Compare November 19, 2026 15:40

@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 Fable 5.2 + Claude Opus 5.5, cross-verified). Only points the reviewers agreed on are posted.

No issues found.

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 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