You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Which issue does this PR close?
- Contribute to #6827
# Rationale for this change
Splitting up #8227.
# What changes are included in this PR?
Migrate `arrow-schema` to Rust 2024
# Are these changes tested?
CI
# Are there any user-facing changes?
Yes
("Int32, ","trailing content after parsing 'Int32'"),
866
864
("Int32(3), ","trailing content after parsing 'Int32'"),
867
-
("FixedSizeBinary(Int32), ","Error finding i64 for FixedSizeBinary, got 'Int32'"),
868
-
("FixedSizeBinary(3.0), ","Error parsing 3.0 as integer: invalid digit found in string"),
865
+
(
866
+
"FixedSizeBinary(Int32), ",
867
+
"Error finding i64 for FixedSizeBinary, got 'Int32'",
868
+
),
869
+
(
870
+
"FixedSizeBinary(3.0), ",
871
+
"Error parsing 3.0 as integer: invalid digit found in string",
872
+
),
869
873
// too large for i32
870
-
("FixedSizeBinary(4000000000), ","Error converting 4000000000 into i32 for FixedSizeBinary: out of range integral type conversion attempted"),
874
+
(
875
+
"FixedSizeBinary(4000000000), ",
876
+
"Error converting 4000000000 into i32 for FixedSizeBinary: out of range integral type conversion attempted",
877
+
),
871
878
// can't have negative precision
872
-
("Decimal32(-3, 5)","Error converting -3 into u8 for Decimal32: out of range integral type conversion attempted"),
873
-
("Decimal64(-3, 5)","Error converting -3 into u8 for Decimal64: out of range integral type conversion attempted"),
874
-
("Decimal128(-3, 5)","Error converting -3 into u8 for Decimal128: out of range integral type conversion attempted"),
875
-
("Decimal256(-3, 5)","Error converting -3 into u8 for Decimal256: out of range integral type conversion attempted"),
876
-
("Decimal32(3, 500)","Error converting 500 into i8 for Decimal32: out of range integral type conversion attempted"),
877
-
("Decimal64(3, 500)","Error converting 500 into i8 for Decimal64: out of range integral type conversion attempted"),
878
-
("Decimal128(3, 500)","Error converting 500 into i8 for Decimal128: out of range integral type conversion attempted"),
879
-
("Decimal256(3, 500)","Error converting 500 into i8 for Decimal256: out of range integral type conversion attempted"),
879
+
(
880
+
"Decimal32(-3, 5)",
881
+
"Error converting -3 into u8 for Decimal32: out of range integral type conversion attempted",
882
+
),
883
+
(
884
+
"Decimal64(-3, 5)",
885
+
"Error converting -3 into u8 for Decimal64: out of range integral type conversion attempted",
886
+
),
887
+
(
888
+
"Decimal128(-3, 5)",
889
+
"Error converting -3 into u8 for Decimal128: out of range integral type conversion attempted",
890
+
),
891
+
(
892
+
"Decimal256(-3, 5)",
893
+
"Error converting -3 into u8 for Decimal256: out of range integral type conversion attempted",
894
+
),
895
+
(
896
+
"Decimal32(3, 500)",
897
+
"Error converting 500 into i8 for Decimal32: out of range integral type conversion attempted",
898
+
),
899
+
(
900
+
"Decimal64(3, 500)",
901
+
"Error converting 500 into i8 for Decimal64: out of range integral type conversion attempted",
902
+
),
903
+
(
904
+
"Decimal128(3, 500)",
905
+
"Error converting 500 into i8 for Decimal128: out of range integral type conversion attempted",
906
+
),
907
+
(
908
+
"Decimal256(3, 500)",
909
+
"Error converting 500 into i8 for Decimal256: out of range integral type conversion attempted",
910
+
),
880
911
("Struct(f1 Int64)","Error unknown token: f1"),
881
912
("Struct(\"f1\" Int64)","Expected ':'"),
882
-
("Struct(\"f1\": )","Error finding next type, got unexpected ')'"),
913
+
(
914
+
"Struct(\"f1\": )",
915
+
"Error finding next type, got unexpected ')'",
916
+
),
883
917
];
884
918
885
919
for(data_type_string, expected_message)in cases {
@@ -906,6 +940,9 @@ mod test {
906
940
fnparse_error_type(){
907
941
let err = parse_data_type("foobar").unwrap_err();
908
942
assert!(matches!(err,ArrowError::ParseError(_)));
909
-
assert_eq!(err.to_string(),"Parser error: Unsupported type 'foobar'. Must be a supported arrow type name such as 'Int32' or 'Timestamp(ns)'. Error unknown token: foobar");
943
+
assert_eq!(
944
+
err.to_string(),
945
+
"Parser error: Unsupported type 'foobar'. Must be a supported arrow type name such as 'Int32' or 'Timestamp(ns)'. Error unknown token: foobar"
0 commit comments