Skip to content

fix: Stop trimming trailing zeros when displaying decimals in SLT tests - #23836

Draft
AdamGS wants to merge 3 commits into
apache:mainfrom
AdamGS:adamg/decimal-slt
Draft

fix: Stop trimming trailing zeros when displaying decimals in SLT tests#23836
AdamGS wants to merge 3 commits into
apache:mainfrom
AdamGS:adamg/decimal-slt

Conversation

@AdamGS

@AdamGS AdamGS commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

This change makes decimal display in SLT tests more explicit, making it easier to detect changes in precision/scale if the type is not asserted explicitly.

What changes are included in this PR?

Skip "normalizing" (which is just trimming trailing 0s) decimals on display in SLT tests.

Are these changes tested?

Existing tests, including changes to them, and one small SLT test.

Are there any user-facing changes?

None, this is test only.

@github-actions github-actions Bot added the sqllogictest SQL Logic Tests (.slt) label Jul 23, 2026
@AdamGS
AdamGS force-pushed the adamg/decimal-slt branch from 82217af to 0eb0669 Compare July 23, 2026 11:42
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.75%. Comparing base (1c8295c) to head (0eb0669).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #23836      +/-   ##
==========================================
- Coverage   80.75%   80.75%   -0.01%     
==========================================
  Files        1089     1089              
  Lines      368809   368823      +14     
  Branches   368809   368823      +14     
==========================================
+ Hits       297837   297841       +4     
- Misses      53217    53225       +8     
- Partials    17755    17757       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@neilconway

Copy link
Copy Markdown
Contributor

@AdamGS Can you take a look at the CI failures?

AdamGS added 3 commits August 3, 2026 16:59
Signed-off-by: Adam Gutglick <adamgsal@gmail.com>
Signed-off-by: Adam Gutglick <adamgsal@gmail.com>
Signed-off-by: Adam Gutglick <adamgsal@gmail.com>
@AdamGS
AdamGS force-pushed the adamg/decimal-slt branch from 0eb0669 to 3ac08d9 Compare August 3, 2026 16:14
@AdamGS

AdamGS commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Ok figured out the issue - PG doesn't report scale, so we infer it from the number of digits in the fractional part.
this means that it doesn't pad out the zeros the same way this change does for data that comes from arrow/DF. I'll try and find a way to bridge this gap while keeping the data more exact.

@AdamGS

AdamGS commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

I'm turning this PR into a draft while I try and find a solution here.

@AdamGS
AdamGS marked this pull request as draft August 5, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decimal values in SLT tests lose display precision if they have trailing zeros

3 participants