Skip to content

fix(data-format): preserve values when expanding scientific notation - #1388

Merged
xuwei-fit2cloud merged 1 commit into
dataease:mainfrom
yangmingshuo5577-jpg:codex/fix-scientific-notation
Sep 21, 2026
Merged

xuwei-fit2cloud merged 1 commit into
dataease:mainfrom
yangmingshuo5577-jpg:codex/fix-scientific-notation

Conversation

@yangmingshuo5577-jpg

Copy link
Copy Markdown
Contributor

Changes

  • Expand floats to fixed-point decimal strings before trimming fractional trailing zeros, preserving their numeric values in query results, live chart data and Excel exports.
  • Add 13 regression cases covering positive and negative exponents, signed values, zero, conversion thresholds and nested rows.

Reason

Fixes #1387.

The previous formatter could retain scientific notation and strip zeros from its exponent: 1.23e20 became 1.23E+2, and 1.23e-10 became 1.23E-1. Formatting with f removes the exponent before trimming zeros from the fractional part.

Validation

  • Python 3.11: the new regression file failed 8 cases before the fix; all 13 cases pass after it.
  • Full test suite (backend/tests and tests): 217 passed, 3 skipped, 1 pre-existing failure in ExecutionErrorDetailsTestCase.test_ai_log_skips_normal_content_after_an_error. The same failure reproduces on unmodified base 2ce3fc71 (204 passed, 3 skipped, 1 failed). MiniMax API tests were skipped without credentials.
  • XLSX write/read check using the production formatting helpers, pandas, xlsxwriter and openpyxl: all 7 sample values preserved; converted values remain text cells.
  • Ruff check and format check pass for the new test file; git diff --check passes. The production file retains the same 5 pre-existing Ruff findings as the base.
  • Full application endpoints were not exercised.

@xuwei-fit2cloud
xuwei-fit2cloud merged commit f48d782 into dataease:main Sep 21, 2026
1 check passed
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.

[BUG] Scientific notation formatting changes numeric values in query results and Excel exports

2 participants