This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/main by this push:
new b278c547a3 fix(arrow-schema): stop asserting on unstable
TryFromIntError message in tests (#10433)
b278c547a3 is described below
commit b278c547a3fe6f8a0a9dc1312e4be2e964bc4135
Author: Aditya Mishra <[email protected]>
AuthorDate: Sun Jul 26 03:42:36 2026 +0530
fix(arrow-schema): stop asserting on unstable TryFromIntError message in
tests (#10433)
# Which issue does this PR close?
No separate issue. The fix is one line per test case and the failing CI
runs are evidence enough.
# Rationale for this change
MIRI CI uses nightly Rust. A recent nightly changed the `Display` output
of `TryFromIntError` from `"out of range integral type conversion
attempted"` to `"number too large to fit in target type"` (and similar
variants). Tests in `datatype_parse.rs` were asserting on that
stdlib-owned suffix, so they broke on MIRI without any change to our
code.
# What changes are included in this PR?
Trimmed 9 expected substrings in `parse_data_type_errors` to stop at the
`:` that separates our message from the stdlib one. The tests now only
assert on the part of the error string we control.
# Are these changes tested?
`parse_data_type_errors` passes on stable. MIRI CI should go green once
this merges.
# Are there any user-facing changes?
No. Test-only change, no behavior or API impact.
---
arrow-schema/src/datatype_parse.rs | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/arrow-schema/src/datatype_parse.rs
b/arrow-schema/src/datatype_parse.rs
index abb7058a32..cc4dbf44ad 100644
--- a/arrow-schema/src/datatype_parse.rs
+++ b/arrow-schema/src/datatype_parse.rs
@@ -1489,7 +1489,7 @@ mod test {
// too large for i32
(
"FixedSizeBinary(4000000000), ",
- "Error converting 4000000000 into i32 for FixedSizeBinary: out
of range integral type conversion attempted",
+ "Error converting 4000000000 into i32 for FixedSizeBinary:",
),
// can't have negative width
(
@@ -1503,35 +1503,35 @@ mod test {
// can't have negative precision
(
"Decimal32(-3, 5)",
- "Error converting -3 into u8 for Decimal32: out of range
integral type conversion attempted",
+ "Error converting -3 into u8 for Decimal32:",
),
(
"Decimal64(-3, 5)",
- "Error converting -3 into u8 for Decimal64: out of range
integral type conversion attempted",
+ "Error converting -3 into u8 for Decimal64:",
),
(
"Decimal128(-3, 5)",
- "Error converting -3 into u8 for Decimal128: out of range
integral type conversion attempted",
+ "Error converting -3 into u8 for Decimal128:",
),
(
"Decimal256(-3, 5)",
- "Error converting -3 into u8 for Decimal256: out of range
integral type conversion attempted",
+ "Error converting -3 into u8 for Decimal256:",
),
(
"Decimal32(3, 500)",
- "Error converting 500 into i8 for Decimal32: out of range
integral type conversion attempted",
+ "Error converting 500 into i8 for Decimal32:",
),
(
"Decimal64(3, 500)",
- "Error converting 500 into i8 for Decimal64: out of range
integral type conversion attempted",
+ "Error converting 500 into i8 for Decimal64:",
),
(
"Decimal128(3, 500)",
- "Error converting 500 into i8 for Decimal128: out of range
integral type conversion attempted",
+ "Error converting 500 into i8 for Decimal128:",
),
(
"Decimal256(3, 500)",
- "Error converting 500 into i8 for Decimal256: out of range
integral type conversion attempted",
+ "Error converting 500 into i8 for Decimal256:",
),
("Struct(f1 Int64)", "Error unknown token: f1"),
("Struct(\"f1\" Int64)", "Expected ':'"),