diff --git a/Cargo.lock b/Cargo.lock index 7f43aaada7a39..d15ecdf7293c0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -181,6 +181,15 @@ version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" +[[package]] +name = "arbitrary" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" +dependencies = [ + "derive_arbitrary", +] + [[package]] name = "arboard" version = "3.4.1" @@ -578,16 +587,15 @@ checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" [[package]] name = "calamine" -version = "0.24.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3a315226fdc5b1c3e33521073e1712a05944bc0664d665ff1f6ff0396334da" +checksum = "138646b9af2c5d7f1804ea4bf93afc597737d2bd4f7341d67c48b03316976eb1" dependencies = [ "byteorder", "chrono", "codepage", "encoding_rs", "log", - "once_cell", "quick-xml 0.31.0", "serde", "zip", @@ -1183,6 +1191,17 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "derive_arbitrary" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "derive_more" version = "0.99.18" @@ -2676,6 +2695,12 @@ dependencies = [ "scopeguard", ] +[[package]] +name = "lockfree-object-pool" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e" + [[package]] name = "log" version = "0.4.22" @@ -5945,6 +5970,12 @@ dependencies = [ "libc", ] +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + [[package]] name = "simd-json" version = "0.13.11" @@ -7787,14 +7818,33 @@ dependencies = [ [[package]] name = "zip" -version = "0.6.6" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +checksum = "dc5e4288ea4057ae23afc69a4472434a87a2495cafce6632fd1c4ec9f5cf3494" dependencies = [ - "byteorder", + "arbitrary", "crc32fast", "crossbeam-utils", + "displaydoc", "flate2", + "indexmap", + "memchr", + "thiserror 1.0.69", + "zopfli", +] + +[[package]] +name = "zopfli" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5019f391bac5cf252e93bbcc53d039ffd62c7bfb7c150414d61369afe57e946" +dependencies = [ + "bumpalo", + "crc32fast", + "lockfree-object-pool", + "log", + "once_cell", + "simd-adler32", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index b9be5c59f3f97..cf836ea6e477f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -71,7 +71,7 @@ brotli = "6.0" byteorder = "1.5" bytes = "1" bytesize = "1.3" -calamine = "0.24.0" +calamine = "0.26.1" chardetng = "0.1.17" chrono = { default-features = false, version = "0.4.34" } chrono-humanize = "0.2.3" diff --git a/crates/nu-command/tests/format_conversions/ods.rs b/crates/nu-command/tests/format_conversions/ods.rs index 34e3e5208c3c0..8a69493cc40ff 100644 --- a/crates/nu-command/tests/format_conversions/ods.rs +++ b/crates/nu-command/tests/format_conversions/ods.rs @@ -29,3 +29,20 @@ fn from_ods_file_to_table_select_sheet() { assert_eq!(actual.out, "SalesOrders"); } + +#[test] +fn from_ods_file_to_table_select_sheet_with_annotations() { + let actual = nu!( + cwd: "tests/fixtures/formats", pipeline( + r#" + open sample_data_with_annotation.ods --raw + | from ods --sheets ["SalesOrders"] + | get SalesOrders + | get column4 + | get 0 + "# + )); + + // The Units column in the sheet SalesOrders has an annotation and should be ignored. + assert_eq!(actual.out, "Units"); +} diff --git a/tests/fixtures/formats/sample_data_with_annotation.ods b/tests/fixtures/formats/sample_data_with_annotation.ods new file mode 100644 index 0000000000000..f4b5c723ea2bc Binary files /dev/null and b/tests/fixtures/formats/sample_data_with_annotation.ods differ