From 1e7b0c8b884f32f1de0841721b722c7627924361 Mon Sep 17 00:00:00 2001 From: Swoorup Joshi Date: Sat, 7 Dec 2024 14:19:29 +0545 Subject: [PATCH] Update dependencies --- Cargo.toml | 5 ++--- arrow_convert/src/features/tinystr.rs | 2 +- arrow_convert/tests/test_tinystr.rs | 8 ++++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0a0b558..a08fade 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,11 +15,10 @@ keywords = ["Arrow", "arrow"] repository = "https://github.com/Swoorup/arrow-convert" [workspace.dependencies] -# workspace crates arrow_convert = { path = "arrow_convert", version = "0.7.2" } arrow_convert_derive = { path = "arrow_convert_derive", version = "0.7.2" } -arrow = "53.0" +arrow = "53.3" chrono = { version = "0.4", default-features = false } criterion = "0.5" err-derive = "0.3" @@ -30,6 +29,6 @@ quote = "1" syn = "2" trybuild = "1.0" pretty_assertions = "1.4" -tinystr = "0.7" +tinystr = "0.8" rust_decimal = "1.36" glam = "0.29" diff --git a/arrow_convert/src/features/tinystr.rs b/arrow_convert/src/features/tinystr.rs index a7d27fa..dd93b63 100644 --- a/arrow_convert/src/features/tinystr.rs +++ b/arrow_convert/src/features/tinystr.rs @@ -32,6 +32,6 @@ impl ArrowDeserialize for TinyAsciiStr { type ArrayType = FixedSizeBinaryArray; fn arrow_deserialize(v: Option<&[u8]>) -> Option { - v.and_then(|bytes| TinyAsciiStr::from_bytes(bytes).ok()) + v.and_then(|bytes| TinyAsciiStr::try_from_utf8(bytes).ok()) } } diff --git a/arrow_convert/tests/test_tinystr.rs b/arrow_convert/tests/test_tinystr.rs index 0e072f7..c8cdcac 100644 --- a/arrow_convert/tests/test_tinystr.rs +++ b/arrow_convert/tests/test_tinystr.rs @@ -7,9 +7,9 @@ fn test_tinyasciistr_roundtrip() { use tinystr::TinyAsciiStr; let original: Vec> = vec![ - TinyAsciiStr::from_str("ABC").unwrap(), - TinyAsciiStr::from_str("XYZ").unwrap(), - TinyAsciiStr::from_str("123").unwrap(), + TinyAsciiStr::try_from_str("ABC").unwrap(), + TinyAsciiStr::try_from_str("XYZ").unwrap(), + TinyAsciiStr::try_from_str("123").unwrap(), ]; // Serialize to Arrow @@ -35,7 +35,7 @@ fn test_tinyasciistr_max_length() { use arrow_convert::serialize::TryIntoArrow; use tinystr::TinyAsciiStr; - let original: Vec> = vec![TinyAsciiStr::from_str("ABCDEFGHIJ").unwrap()]; + let original: Vec> = vec![TinyAsciiStr::try_from_str("ABCDEFGHIJ").unwrap()]; let arrow_array: ArrayRef = original.try_into_arrow().expect("Failed to convert to Arrow array"); assert!(arrow_array.as_any().is::());