Repository navigation
Conversation
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
Fixes #51760.
Casting an integral floating-point value to a string currently produces
20rather than20.0. The CSV writer uses that cast, so a first fragment containing only whole-number floats is inferred asint64; scanning a later fragment with fractional values then fails.What changes are included in this PR?
Enable
EMIT_TRAILING_DECIMAL_POINTandEMIT_TRAILING_ZERO_AFTER_POINTin the default floating-point formatter, as suggested in the issue.Extend the existing float16/float32/float64 formatter and cast tests, update affected scalar and pretty-print expectations, and add a CSV dataset regression covering float32/float64 inputs with threaded and serial scans. The regression also checks that integer columns retain integer output and inference.
Are these changes tested?
Built Arrow C++ and PyArrow from the patched source. Removing only the two flags and rebuilding reproduced the exact reported
int64conversion error and failed all four regression cases; restoring them made the original example and the regression pass.git diff --checkpassed.Validation used a Release C++ build with compute, CSV, dataset, filesystem, IPC, and JSON enabled; RE2, utf8proc, and optional compression libraries were disabled.
Are there any user-facing changes?
Integral floats in ordinary decimal notation now include
.0in string casts, CSV output, scalar strings, and array display, including-0.0. Fractional values, scientific notation (for example,1e+10), infinity, NaN, and integer formatting keep their existing spelling.Was AI used for this PR?
AI assisted with the implementation, tests, validation, and description. The production change follows the formatter flags proposed by the issue author.
PR code and description written by:
Reviewed before submission by: