diff --git a/Cargo.lock b/Cargo.lock index ecad53d2d8..1e4b123f81 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -221,6 +221,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf7d0a018de4f6aa429b9d33d69edf69072b1c5b1cb8d3e4a5f7ef898fc3eb76" +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + [[package]] name = "arrayvec" version = "0.5.2" @@ -376,7 +382,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "rustc-hash", + "rustc-hash 1.1.0", "shlex", "syn 2.0.87", ] @@ -423,6 +429,19 @@ dependencies = [ "wyz", ] +[[package]] +name = "blake3" +version = "1.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8ee0c1824c4dea5b5f81736aff91bae041d2c07ee1192bec91054e10e3e601e" +dependencies = [ + "arrayref", + "arrayvec 0.7.6", + "cc", + "cfg-if", + "constant_time_eq", +] + [[package]] name = "block-buffer" version = "0.10.4" @@ -753,6 +772,33 @@ dependencies = [ "stacker", ] +[[package]] +name = "ciborium" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" + +[[package]] +name = "ciborium-ll" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" +dependencies = [ + "ciborium-io", + "half", +] + [[package]] name = "clang-sys" version = "1.8.1" @@ -793,7 +839,7 @@ version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ - "heck", + "heck 0.5.0", "proc-macro2", "quote", "syn 2.0.87", @@ -931,6 +977,12 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "constant_time_eq" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" + [[package]] name = "core-foundation" version = "0.9.4" @@ -941,6 +993,16 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -1571,9 +1633,9 @@ dependencies = [ [[package]] name = "float-cmp" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" +checksum = "b09cf3155332e944990140d967ff5eceb70df778b34f77d8075db46e4704e6d8" dependencies = [ "num-traits", ] @@ -1614,6 +1676,16 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs4" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8c6b3bd49c37d2aa3f3f2220233b29a7cd23f79d1fe70e5337d25fb390793de" +dependencies = [ + "rustix", + "windows-sys 0.52.0", +] + [[package]] name = "fs_extra" version = "1.3.0" @@ -1854,6 +1926,16 @@ dependencies = [ "tracing", ] +[[package]] +name = "half" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +dependencies = [ + "cfg-if", + "crunchy", +] + [[package]] name = "halfbrown" version = "0.2.5" @@ -1903,6 +1985,8 @@ dependencies = [ "allocator-api2", "equivalent", "foldhash", + "rayon", + "serde", ] [[package]] @@ -1924,6 +2008,12 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + [[package]] name = "heck" version = "0.5.0" @@ -2067,6 +2157,25 @@ dependencies = [ "pin-project-lite", "smallvec", "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +dependencies = [ + "futures-util", + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-native-certs", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", ] [[package]] @@ -2076,12 +2185,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ "bytes", + "futures-channel", "futures-util", "http", "http-body", "hyper", "pin-project-lite", + "socket2", "tokio", + "tower-service", + "tracing", ] [[package]] @@ -2279,6 +2392,12 @@ dependencies = [ "web-time", ] +[[package]] +name = "indoc" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" + [[package]] name = "inotify" version = "0.9.6" @@ -2318,6 +2437,12 @@ version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f958d3d68f4167080a18141e10381e7634563984a537f2a49a30fd8e53ac5767" +[[package]] +name = "ipnet" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" + [[package]] name = "is-docker" version = "0.2.0" @@ -2475,70 +2600,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -[[package]] -name = "lexical-core" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0431c65b318a590c1de6b8fd6e72798c92291d27762d94c9e6c37ed7a73d8458" -dependencies = [ - "lexical-parse-float", - "lexical-parse-integer", - "lexical-util", - "lexical-write-float", - "lexical-write-integer", -] - -[[package]] -name = "lexical-parse-float" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb17a4bdb9b418051aa59d41d65b1c9be5affab314a872e5ad7f06231fb3b4e0" -dependencies = [ - "lexical-parse-integer", - "lexical-util", - "static_assertions", -] - -[[package]] -name = "lexical-parse-integer" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5df98f4a4ab53bf8b175b363a34c7af608fe31f93cc1fb1bf07130622ca4ef61" -dependencies = [ - "lexical-util", - "static_assertions", -] - -[[package]] -name = "lexical-util" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85314db53332e5c192b6bca611fb10c114a80d1b831ddac0af1e9be1b9232ca0" -dependencies = [ - "static_assertions", -] - -[[package]] -name = "lexical-write-float" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e7c3ad4e37db81c1cbe7cf34610340adc09c322871972f74877a712abc6c809" -dependencies = [ - "lexical-util", - "lexical-write-integer", - "static_assertions", -] - -[[package]] -name = "lexical-write-integer" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb89e9f6958b83258afa3deed90b5de9ef68eef090ad5086c791cd2345610162" -dependencies = [ - "lexical-util", - "static_assertions", -] - [[package]] name = "libc" version = "0.2.162" @@ -2849,6 +2910,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + [[package]] name = "miette" version = "7.4.0" @@ -3016,7 +3086,7 @@ dependencies = [ "openssl-probe", "openssl-sys", "schannel", - "security-framework", + "security-framework 2.11.1", "security-framework-sys", "tempfile", ] @@ -3217,7 +3287,7 @@ name = "nu-cmd-extra" version = "0.100.1" dependencies = [ "fancy-regex", - "heck", + "heck 0.5.0", "itertools 0.13.0", "nu-ansi-term", "nu-cmd-base", @@ -3386,7 +3456,7 @@ dependencies = [ name = "nu-derive-value" version = "0.100.1" dependencies = [ - "heck", + "heck 0.5.0", "proc-macro-error", "proc-macro2", "quote", @@ -3593,7 +3663,7 @@ dependencies = [ "dirs", "dirs-sys", "fancy-regex", - "heck", + "heck 0.5.0", "indexmap", "log", "lru", @@ -4034,6 +4104,36 @@ dependencies = [ "memchr", ] +[[package]] +name = "object_store" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6da452820c715ce78221e8202ccc599b4a52f3e1eb3eedb487b680c81a8e3f3" +dependencies = [ + "async-trait", + "base64", + "bytes", + "chrono", + "futures", + "humantime", + "hyper", + "itertools 0.13.0", + "md-5", + "parking_lot", + "percent-encoding", + "quick-xml 0.36.2", + "rand", + "reqwest", + "ring", + "serde", + "serde_json", + "snafu", + "tokio", + "tracing", + "url", + "walkdir", +] + [[package]] name = "oem_cp" version = "2.0.0" @@ -4200,16 +4300,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "parquet-format-safe" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1131c54b167dd4e4799ce762e1ab01549ebb94d5bdd13e6ec1b467491c378e1f" -dependencies = [ - "async-trait", - "futures", -] - [[package]] name = "parse-zoneinfo" version = "0.3.1" @@ -4438,9 +4528,9 @@ dependencies = [ [[package]] name = "polars" -version = "0.43.1" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e248cf2f0069277f8fe80d413cfb9240c7dd1cfa382b5674c1b4afa57222747" +checksum = "f65c6aa86d991a64c95416a61202f7952da2f8cccefa448f9a23c1b8f2301ecc" dependencies = [ "getrandom", "polars-arrow", @@ -4458,9 +4548,9 @@ dependencies = [ [[package]] name = "polars-arrow" -version = "0.43.1" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2981d5b2f34c84069a39fceca0d36dffeb97db8cadba101e7ea6605c8d42294d" +checksum = "87dbb24d29ddea5abb73d7954df8b8d3d4bb7f02a3e5c96d1519cdad9e816a3d" dependencies = [ "ahash 0.8.11", "atoi", @@ -4473,9 +4563,8 @@ dependencies = [ "either", "ethnum", "fast-float", - "futures", "getrandom", - "hashbrown 0.14.5", + "hashbrown 0.15.1", "itoa", "itoap", "lz4", @@ -4491,6 +4580,7 @@ dependencies = [ "simdutf8", "streaming-iterator", "strength_reduce", + "strum_macros", "version_check", "zstd", ] @@ -4507,9 +4597,9 @@ dependencies = [ [[package]] name = "polars-compute" -version = "0.43.1" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a97b2a5c9b880ab7e52553c40a336fdb6e3244bf896b4d4917700defe8085d5" +checksum = "cbdb1071147452a4c4b25560f23d2fbaffef255b04757291131b22fc2c0d35b2" dependencies = [ "bytemuck", "either", @@ -4523,9 +4613,9 @@ dependencies = [ [[package]] name = "polars-core" -version = "0.43.1" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5bc2cadcca904a9dc4d2c2b437c346712806e9a678bf17c7e94ebf622faae76" +checksum = "dd5df9b55e614088a3270b06f8649dce76537c268d6b1ca4d9c37008b2be5949" dependencies = [ "ahash 0.8.11", "bitflags 2.6.0", @@ -4535,6 +4625,7 @@ dependencies = [ "comfy-table", "either", "hashbrown 0.14.5", + "hashbrown 0.15.1", "indexmap", "num-traits", "once_cell", @@ -4550,6 +4641,7 @@ dependencies = [ "regex", "serde", "serde_json", + "strum_macros", "thiserror 1.0.69", "version_check", "xxhash-rust", @@ -4557,11 +4649,12 @@ dependencies = [ [[package]] name = "polars-error" -version = "0.43.1" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56b0a8eb9b1e56a4640de6887d613cb4de73c4e09d491f3b779855d4c3bcb9ba" +checksum = "4643898a644f30c83737db85f942f8c8956b0c11190b39afec745218eae1746b" dependencies = [ "avro-schema", + "object_store", "polars-arrow-format", "regex", "simdutf8", @@ -4570,12 +4663,14 @@ dependencies = [ [[package]] name = "polars-expr" -version = "0.43.1" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34e9c0e8c7ba93aac64051b92dc68eac5a0e9543cf44ca784467db2c035821fe" +checksum = "ea1b431ed816cba1120cff200f06b962748001bbb2e615ce53cfbbdf701cc136" dependencies = [ "ahash 0.8.11", "bitflags 2.6.0", + "hashbrown 0.15.1", + "num-traits", "once_cell", "polars-arrow", "polars-compute", @@ -4583,32 +4678,37 @@ dependencies = [ "polars-io", "polars-ops", "polars-plan", + "polars-row", "polars-time", "polars-utils", + "rand", "rayon", ] [[package]] name = "polars-io" -version = "0.43.1" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "454ebbebe1cb8cb4768adca44b8fc9431abc3c91d5927f6824e73f916bced911" +checksum = "b2fab2c016635cb416b49461fd6419b0208c6c13a4fd065bd65e4a87dbb66314" dependencies = [ "ahash 0.8.11", "async-trait", "atoi_simd", + "blake3", "bytes", "chrono", "fast-float", "flate2", + "fs4", "futures", "glob", - "hashbrown 0.14.5", + "hashbrown 0.15.1", "home", "itoa", "memchr", "memmap2", "num-traits", + "object_store", "once_cell", "percent-encoding", "polars-arrow", @@ -4619,27 +4719,31 @@ dependencies = [ "polars-schema", "polars-time", "polars-utils", + "pyo3", "rayon", "regex", + "reqwest", "ryu", "serde", + "serde_json", "simd-json", "simdutf8", "tokio", "tokio-util", + "url", "zstd", ] [[package]] name = "polars-json" -version = "0.43.1" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca086fbbff6e46efbc97032e93f92690c1fc9c662fd5e1f13a42922bd7d3aa4" +checksum = "d5c8c057ef04feaf34b6ce52096bdea3a766fa4725f50442078c8a4ee86397bf" dependencies = [ "ahash 0.8.11", "chrono", "fallible-streaming-iterator", - "hashbrown 0.14.5", + "hashbrown 0.15.1", "indexmap", "itoa", "num-traits", @@ -4653,9 +4757,9 @@ dependencies = [ [[package]] name = "polars-lazy" -version = "0.43.1" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e61c062e833d2376de0a4cf745504449215cbf499cea293cb592e674ffb39ca" +checksum = "4a8ca74f42e7b47cad241b36b98d991cc7fbb51b8d0695a055eb937588d1f310" dependencies = [ "ahash 0.8.11", "bitflags 2.6.0", @@ -4670,6 +4774,7 @@ dependencies = [ "polars-ops", "polars-pipe", "polars-plan", + "polars-stream", "polars-time", "polars-utils", "rayon", @@ -4678,10 +4783,11 @@ dependencies = [ [[package]] name = "polars-mem-engine" -version = "0.43.1" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0643812829cc990e1533a5bf48c21a1b3eaa46aabf2967b0f53f99097cbc74c" +checksum = "7a32614e5b52c9b83856d80c7e2880b79d83055bfd59969bd1d0b148f9cfdc7a" dependencies = [ + "futures", "memmap2", "polars-arrow", "polars-core", @@ -4693,14 +4799,16 @@ dependencies = [ "polars-plan", "polars-time", "polars-utils", + "pyo3", "rayon", + "tokio", ] [[package]] name = "polars-ops" -version = "0.43.1" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ac14a136d87bea798f3db51d5987556deb2293da34bfc8b105ebffa05f6e810" +checksum = "035c800fbe5bbd820afeb8313713ed345853bb014e0f821a4025d40cf0d60e1a" dependencies = [ "ahash 0.8.11", "argminmax", @@ -4709,7 +4817,7 @@ dependencies = [ "chrono", "chrono-tz 0.8.6", "either", - "hashbrown 0.14.5", + "hashbrown 0.15.1", "hex", "indexmap", "jsonpath_lib_polars_vendor", @@ -4726,17 +4834,19 @@ dependencies = [ "rand_distr", "rayon", "regex", + "regex-syntax", "serde", "serde_json", + "strum_macros", "unicode-reverse", "version_check", ] [[package]] name = "polars-parquet" -version = "0.43.1" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "491f5af321169259d5b1294c9fe8ed89faaeac34b4dec4abcedc0d1b3d11013a" +checksum = "91dcf1d9f048079376949eaf2e24e240b313ff4a102fb83b57c9a5f807cdca52" dependencies = [ "ahash 0.8.11", "async-stream", @@ -4746,13 +4856,13 @@ dependencies = [ "ethnum", "flate2", "futures", - "hashbrown 0.14.5", + "hashbrown 0.15.1", "lz4", "num-traits", - "parquet-format-safe", "polars-arrow", "polars-compute", "polars-error", + "polars-parquet-format", "polars-utils", "serde", "simdutf8", @@ -4762,16 +4872,26 @@ dependencies = [ ] [[package]] -name = "polars-pipe" -version = "0.43.1" +name = "polars-parquet-format" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29215c31f599295cc0f803c42fc812cc518db6d5ed4d6c7cc03daf3976a0add5" +checksum = "c025243dcfe8dbc57e94d9f82eb3bef10b565ab180d5b99bed87fd8aea319ce1" +dependencies = [ + "async-trait", + "futures", +] + +[[package]] +name = "polars-pipe" +version = "0.44.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05936f2b3981eecb2fe74d8ef092bb75a93d2a056b3e4f339f4ac20c71c9e331" dependencies = [ "crossbeam-channel", "crossbeam-queue", "enum_dispatch", "futures", - "hashbrown 0.14.5", + "hashbrown 0.15.1", "num-traits", "polars-arrow", "polars-compute", @@ -4789,9 +4909,9 @@ dependencies = [ [[package]] name = "polars-plan" -version = "0.43.1" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3f728df4bc643492a2057a0a125c7e550cbcfe35b391444653ad294be9ab190" +checksum = "23de436f33f4d1134c58f24e7059a221b957ec20730807e0ef0c80c8e4b3d06a" dependencies = [ "ahash 0.8.11", "bitflags 2.6.0", @@ -4799,9 +4919,12 @@ dependencies = [ "bytes", "chrono", "chrono-tz 0.8.6", + "ciborium", "either", - "hashbrown 0.14.5", + "futures", + "hashbrown 0.15.1", "memmap2", + "num-traits", "once_cell", "percent-encoding", "polars-arrow", @@ -4812,6 +4935,7 @@ dependencies = [ "polars-parquet", "polars-time", "polars-utils", + "pyo3", "rayon", "recursive", "regex", @@ -4822,9 +4946,9 @@ dependencies = [ [[package]] name = "polars-row" -version = "0.43.1" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eb931f0929ca7498b3ed5056357d2d364cad42cce95383a7e3983dbceb4bed1" +checksum = "3823d3de3e614509bba6929798f1f3d5ae05c1cdfc4eb7029d2ec6ad77201da2" dependencies = [ "bytemuck", "polars-arrow", @@ -4834,9 +4958,9 @@ dependencies = [ [[package]] name = "polars-schema" -version = "0.43.1" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7e1234b942d3244024ecbac9c7f5a48a52a815f8ca4b9d075fbba16afb1a39" +checksum = "d88667f770291cefa2e8cd366a54f29dc6fe362e9a263914c903db411a58ac1d" dependencies = [ "indexmap", "polars-error", @@ -4847,9 +4971,9 @@ dependencies = [ [[package]] name = "polars-sql" -version = "0.43.1" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce52bfd2ef1e2e18ac26d7d7ea3f9132b199cff06d975156703fa5badcfae187" +checksum = "69451f08363bb497407f6ebebe00bc01972a51716d20d115b75f9b5326f1f3c8" dependencies = [ "hex", "once_cell", @@ -4868,10 +4992,39 @@ dependencies = [ ] [[package]] -name = "polars-time" -version = "0.43.1" +name = "polars-stream" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9925ab75e1d859ae2283ca09d7683198b0b9ff5afecd03f2c9180f3e36e35056" +checksum = "188622b0a4bc4530cf91a288134254ffa065d18932e261075377914225e757c2" +dependencies = [ + "atomic-waker", + "crossbeam-deque", + "crossbeam-utils", + "futures", + "memmap2", + "parking_lot", + "pin-project-lite", + "polars-core", + "polars-error", + "polars-expr", + "polars-io", + "polars-mem-engine", + "polars-parquet", + "polars-plan", + "polars-utils", + "rand", + "rayon", + "recursive", + "slotmap", + "tokio", + "version_check", +] + +[[package]] +name = "polars-time" +version = "0.44.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f36e4d6b19f2c406faea585b9a1814f422fc5b310f65ccf8a55216df0754ef" dependencies = [ "atoi", "bytemuck", @@ -4886,25 +5039,27 @@ dependencies = [ "polars-utils", "regex", "serde", + "strum_macros", ] [[package]] name = "polars-utils" -version = "0.43.1" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b44846e1fc6ae1dfdc7f65a37af7d270d0a6a17a58fff76716561f5b887a8ad7" +checksum = "96186b70bda00c90b5027bf2f69193c5c40571e80d3e8ec505c22cdc8e3e39aa" dependencies = [ "ahash 0.8.11", "bytemuck", "bytes", "compact_str 0.8.0", - "hashbrown 0.14.5", + "hashbrown 0.15.1", "indexmap", "libc", "memmap2", "num-traits", "once_cell", "polars-error", + "pyo3", "raw-cpuid", "rayon", "serde", @@ -5107,6 +5262,69 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "pyo3" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e00b96a521718e08e03b1a622f01c8a8deb50719335de3f60b3b3950f069d8" +dependencies = [ + "cfg-if", + "indoc", + "libc", + "memoffset", + "parking_lot", + "portable-atomic", + "pyo3-build-config", + "pyo3-ffi", + "pyo3-macros", + "unindent", +] + +[[package]] +name = "pyo3-build-config" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7883df5835fafdad87c0d888b266c8ec0f4c9ca48a5bed6bbb592e8dedee1b50" +dependencies = [ + "once_cell", + "target-lexicon", +] + +[[package]] +name = "pyo3-ffi" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01be5843dc60b916ab4dad1dca6d20b9b4e6ddc8e15f50c47fe6d85f1fb97403" +dependencies = [ + "libc", + "pyo3-build-config", +] + +[[package]] +name = "pyo3-macros" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77b34069fc0682e11b31dbd10321cbf94808394c56fd996796ce45217dfac53c" +dependencies = [ + "proc-macro2", + "pyo3-macros-backend", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "pyo3-macros-backend" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08260721f32db5e1a5beae69a55553f56b99bd0e1c3e6e0a5e8851a9d0f5a85c" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "pyo3-build-config", + "quote", + "syn 2.0.87", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -5145,6 +5363,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe" dependencies = [ "memchr", + "serde", ] [[package]] @@ -5178,6 +5397,58 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "quinn" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash 2.0.0", + "rustls", + "socket2", + "thiserror 2.0.3", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" +dependencies = [ + "bytes", + "getrandom", + "rand", + "ring", + "rustc-hash 2.0.0", + "rustls", + "rustls-pki-types", + "slab", + "thiserror 2.0.3", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5a626c6807713b15cac82a6acaccd6043c9a5408c24baae07611fec3f243da" +dependencies = [ + "cfg_aliases 0.2.1", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.59.0", +] + [[package]] name = "quote" version = "1.0.37" @@ -5420,6 +5691,51 @@ dependencies = [ "bytecheck", ] +[[package]] +name = "reqwest" +version = "0.12.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" +dependencies = [ + "base64", + "bytes", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-native-certs", + "rustls-pemfile", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-rustls", + "tokio-util", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "windows-registry", +] + [[package]] name = "rfc2047-decoder" version = "1.0.6" @@ -5434,6 +5750,21 @@ dependencies = [ "thiserror 2.0.3", ] +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.52.0", +] + [[package]] name = "rkyv" version = "0.7.45" @@ -5622,6 +5953,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" + [[package]] name = "rustc_version" version = "0.4.1" @@ -5644,6 +5981,61 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rustls" +version = "0.23.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" +dependencies = [ + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework 3.0.1", +] + +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +dependencies = [ + "web-time", +] + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + [[package]] name = "rustversion" version = "1.0.18" @@ -5749,7 +6141,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ "bitflags 2.6.0", - "core-foundation", + "core-foundation 0.9.4", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1415a607e92bec364ea2cf9264646dcce0f91e6d65281bd6f2819cca3bf39c8" +dependencies = [ + "bitflags 2.6.0", + "core-foundation 0.10.0", "core-foundation-sys", "libc", "security-framework-sys", @@ -5975,14 +6380,13 @@ checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" [[package]] name = "simd-json" -version = "0.13.11" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0228a564470f81724e30996bbc2b171713b37b15254a6440c7e2d5449b95691" +checksum = "aa2bcf6c6e164e81bc7a5d49fc6988b3d515d9e8c07457d7b74ffb9324b9cd40" dependencies = [ "ahash 0.8.11", "getrandom", "halfbrown", - "lexical-core", "once_cell", "ref-cast", "serde", @@ -6029,12 +6433,43 @@ dependencies = [ "autocfg", ] +[[package]] +name = "slotmap" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" +dependencies = [ + "version_check", +] + [[package]] name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +[[package]] +name = "snafu" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4de37ad025c587a29e8f3f5605c00f70b98715ef90b9061a815b9e59e9042d6" +dependencies = [ + "doc-comment", + "snafu-derive", +] + +[[package]] +name = "snafu-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990079665f075b699031e9c08fd3ab99be5029b96f3b78dc0709e8f77e4efebf" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "snap" version = "1.1.1" @@ -6051,6 +6486,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "sqlparser" version = "0.49.0" @@ -6178,13 +6619,19 @@ version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck", + "heck 0.5.0", "proc-macro2", "quote", "rustversion", "syn 2.0.87", ] +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + [[package]] name = "supports-color" version = "2.1.0" @@ -6259,6 +6706,15 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + [[package]] name = "synstructure" version = "0.13.1" @@ -6350,6 +6806,12 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1bbb9f3c5c463a01705937a24fdabc5047929ac764b2d5b9cf681c1f5041ed5" +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + [[package]] name = "tempfile" version = "3.14.0" @@ -6550,9 +7012,32 @@ dependencies = [ "parking_lot", "pin-project-lite", "socket2", + "tokio-macros", "windows-sys 0.52.0", ] +[[package]] +name = "tokio-macros" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +dependencies = [ + "rustls", + "rustls-pki-types", + "tokio", +] + [[package]] name = "tokio-util" version = "0.7.12" @@ -6626,6 +7111,12 @@ dependencies = [ "winnow 0.6.20", ] +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + [[package]] name = "tracing" version = "0.1.40" @@ -6633,9 +7124,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "pin-project-lite", + "tracing-attributes", "tracing-core", ] +[[package]] +name = "tracing-attributes" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "tracing-core" version = "0.1.32" @@ -6681,6 +7184,12 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "343e926fc669bc8cde4fa3129ab681c63671bae288b1f1081ceee6d9d37904fc" +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + [[package]] name = "typed-arena" version = "1.7.0" @@ -6800,12 +7309,24 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" +[[package]] +name = "unindent" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce" + [[package]] name = "unsafe-libyaml" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "ureq" version = "2.10.1" @@ -7015,9 +7536,9 @@ checksum = "4e8257fbc510f0a46eb602c10215901938b5c2a7d5e70fc11483b1d3c9b5b18c" [[package]] name = "value-trait" -version = "0.8.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad8db98c1e677797df21ba03fca7d3bf9bec3ca38db930954e4fe6e1ea27eb4" +checksum = "9170e001f458781e92711d2ad666110f153e4e50bfd5cbd02db6547625714187" dependencies = [ "float-cmp", "halfbrown", @@ -7087,6 +7608,15 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -7119,6 +7649,18 @@ dependencies = [ "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "wasm-bindgen-macro" version = "0.2.95" @@ -7148,6 +7690,19 @@ version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" +[[package]] +name = "wasm-streams" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "wax" version = "0.6.0" @@ -7236,6 +7791,16 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "web-sys" +version = "0.3.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "web-time" version = "1.1.0" @@ -7355,7 +7920,7 @@ checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" dependencies = [ "windows-implement 0.56.0", "windows-interface 0.56.0", - "windows-result", + "windows-result 0.1.2", "windows-targets 0.52.6", ] @@ -7367,7 +7932,7 @@ checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" dependencies = [ "windows-implement 0.57.0", "windows-interface 0.57.0", - "windows-result", + "windows-result 0.1.2", "windows-targets 0.52.6", ] @@ -7415,6 +7980,17 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result 0.2.0", + "windows-strings", + "windows-targets 0.52.6", +] + [[package]] name = "windows-result" version = "0.1.2" @@ -7424,6 +8000,25 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result 0.2.0", + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -7774,6 +8369,12 @@ dependencies = [ "synstructure", ] +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + [[package]] name = "zerovec" version = "0.10.4" diff --git a/crates/nu_plugin_polars/Cargo.toml b/crates/nu_plugin_polars/Cargo.toml index fafbb8cb7d..a4f639ca13 100644 --- a/crates/nu_plugin_polars/Cargo.toml +++ b/crates/nu_plugin_polars/Cargo.toml @@ -31,11 +31,11 @@ mimalloc = { version = "0.1.42" } num = {version = "0.4"} serde = { version = "1.0", features = ["derive"] } sqlparser = { version = "0.49"} -polars-io = { version = "0.43", features = ["avro"]} -polars-arrow = { version = "0.43"} -polars-ops = { version = "0.43", features = ["pivot"]} -polars-plan = { version = "0.43", features = ["regex"]} -polars-utils = { version = "0.43"} +polars-io = { version = "0.44", features = ["avro"]} +polars-arrow = { version = "0.44"} +polars-ops = { version = "0.44", features = ["pivot"]} +polars-plan = { version = "0.44", features = ["regex"]} +polars-utils = { version = "0.44"} typetag = "0.2" env_logger = "0.11.3" log.workspace = true @@ -81,7 +81,7 @@ features = [ "to_dummies", ] optional = false -version = "0.43" +version = "0.44" [dev-dependencies] nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.100.1" } diff --git a/crates/nu_plugin_polars/src/dataframe/command/aggregation/quantile.rs b/crates/nu_plugin_polars/src/dataframe/command/aggregation/quantile.rs index def85a3e01..e2572012cb 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/aggregation/quantile.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/aggregation/quantile.rs @@ -10,7 +10,7 @@ use nu_protocol::{ Category, Example, LabeledError, PipelineData, ShellError, Signature, Span, SyntaxShape, Type, Value, }; -use polars::prelude::{lit, QuantileInterpolOptions}; +use polars::prelude::{lit, QuantileMethod}; #[derive(Clone)] pub struct LazyQuantile; @@ -109,7 +109,7 @@ impl PluginCommand for LazyQuantile { PolarsPluginObject::NuExpression(expr) => { let expr: NuExpression = expr .into_polars() - .quantile(lit(quantile), QuantileInterpolOptions::default()) + .quantile(lit(quantile), QuantileMethod::default()) .into(); expr.to_pipeline_data(plugin, engine, call.head) } @@ -136,7 +136,7 @@ fn command( let lazy = NuLazyFrame::new( lazy.from_eager, lazy.to_polars() - .quantile(lit(quantile), QuantileInterpolOptions::default()), + .quantile(lit(quantile), QuantileMethod::default()), ); lazy.to_pipeline_data(plugin, engine, call.head) diff --git a/crates/nu_plugin_polars/src/dataframe/command/core/open.rs b/crates/nu_plugin_polars/src/dataframe/command/core/open.rs index ad430c6885..856c037270 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/core/open.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/core/open.rs @@ -28,9 +28,7 @@ use polars::{ }, }; -use polars_io::{ - avro::AvroReader, csv::read::CsvReadOptions, prelude::ParallelStrategy, HiveOptions, -}; +use polars_io::{avro::AvroReader, csv::read::CsvReadOptions, HiveOptions}; const DEFAULT_INFER_SCHEMA: usize = 100; @@ -179,20 +177,7 @@ fn from_parquet( ) -> Result { if !call.has_flag("eager")? { let file: String = call.req(0)?; - let args = ScanArgsParquet { - n_rows: None, - cache: true, - parallel: ParallelStrategy::Auto, - rechunk: false, - row_index: None, - low_memory: false, - cloud_options: None, - use_statistics: false, - hive_options: HiveOptions::default(), - glob: true, - include_file_paths: None, - }; - + let args = ScanArgsParquet::default(); let df: NuLazyFrame = LazyFrame::scan_parquet(file, args) .map_err(|e| ShellError::GenericError { error: "Parquet reader error".into(), diff --git a/crates/nu_plugin_polars/src/dataframe/command/core/summary.rs b/crates/nu_plugin_polars/src/dataframe/command/core/summary.rs index 8710b9bc01..b00a8bb201 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/core/summary.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/core/summary.rs @@ -10,8 +10,8 @@ use nu_protocol::{ use polars::{ chunked_array::ChunkedArray, prelude::{ - AnyValue, DataFrame, DataType, Float64Type, IntoSeries, NewChunkedArray, - QuantileInterpolOptions, Series, StringType, + AnyValue, Column as PolarsColumn, DataFrame, DataType, Float64Type, IntoSeries, + NewChunkedArray, QuantileMethod, StringType, }, }; @@ -184,7 +184,6 @@ fn command( let tail = df .as_ref() - .get_columns() .iter() .filter(|col| !matches!(col.dtype(), &DataType::Object("object", _))) .map(|col| { @@ -200,7 +199,7 @@ fn command( .clone() .into_iter() .map(|q| { - col.quantile_reduce(q, QuantileInterpolOptions::default()) + col.quantile_reduce(q, QuantileMethod::default()) .ok() .map(|s| s.into_series("quantile".into())) .and_then(|ca| ca.cast(&DataType::Float64).ok()) @@ -221,7 +220,10 @@ fn command( ChunkedArray::::from_slice_options(name.into(), &descriptors).into_series() }); - let res = head.chain(tail).collect::>(); + let res = head + .chain(tail) + .map(PolarsColumn::from) + .collect::>(); let polars_df = DataFrame::new(res).map_err(|e| ShellError::GenericError { error: "Dataframe Error".into(), diff --git a/crates/nu_plugin_polars/src/dataframe/command/data/rename.rs b/crates/nu_plugin_polars/src/dataframe/command/data/rename.rs index ae7e93b6b8..3265a5c7fa 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/data/rename.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/data/rename.rs @@ -185,7 +185,7 @@ fn command_lazy( } let lazy = lazy.to_polars(); - let lazy: NuLazyFrame = lazy.rename(&columns, &new_names).into(); + let lazy: NuLazyFrame = lazy.rename(&columns, &new_names, true).into(); lazy.to_pipeline_data(plugin, engine, call.head) } diff --git a/crates/nu_plugin_polars/src/dataframe/command/string/str_slice.rs b/crates/nu_plugin_polars/src/dataframe/command/string/str_slice.rs index 4db8ac0f67..02d35e6984 100644 --- a/crates/nu_plugin_polars/src/dataframe/command/string/str_slice.rs +++ b/crates/nu_plugin_polars/src/dataframe/command/string/str_slice.rs @@ -160,13 +160,14 @@ fn command_df( df: NuDataFrame, ) -> Result { let start: i64 = call.req(0)?; - let start = Series::new("".into(), &[start]); + let start = Series::new("".into(), &[start]).into(); let length: Option = call.get_flag("length")?; let length = match length { Some(v) => Series::new("".into(), &[v as u64]), None => Series::new_null("".into(), 1), - }; + } + .into(); let series = df.as_series(call.head)?; diff --git a/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/between_values.rs b/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/between_values.rs index 7d34d6d128..507107c7ae 100644 --- a/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/between_values.rs +++ b/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/between_values.rs @@ -5,8 +5,8 @@ use nu_protocol::{ }; use num::Zero; use polars::prelude::{ - BooleanType, ChunkCompare, ChunkedArray, DataType, Float64Type, Int64Type, IntoSeries, - NumOpsDispatchChecked, PolarsError, Series, StringNameSpaceImpl, + BooleanType, ChunkCompareEq, ChunkCompareIneq, ChunkedArray, DataType, Float64Type, Int64Type, + IntoSeries, NumOpsDispatchChecked, PolarsError, Series, StringNameSpaceImpl, }; use std::ops::{Add, BitAnd, BitOr, Div, Mul, Sub}; diff --git a/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/conversion.rs b/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/conversion.rs index c2d64741f4..77457dee0c 100644 --- a/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/conversion.rs +++ b/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/conversion.rs @@ -10,11 +10,11 @@ use polars::chunked_array::ChunkedArray; use polars::datatypes::{AnyValue, PlSmallStr}; use polars::export::arrow::Either; use polars::prelude::{ - ChunkAnyValue, DataFrame, DataType, DatetimeChunked, Float32Type, Float64Type, Int16Type, - Int32Type, Int64Type, Int8Type, IntoSeries, ListBooleanChunkedBuilder, ListBuilderTrait, - ListPrimitiveChunkedBuilder, ListStringChunkedBuilder, ListType, NamedFrom, NewChunkedArray, - ObjectType, PolarsError, Schema, SchemaExt, Series, StructChunked, TemporalMethods, TimeUnit, - UInt16Type, UInt32Type, UInt64Type, UInt8Type, + ChunkAnyValue, Column as PolarsColumn, DataFrame, DataType, DatetimeChunked, Float32Type, + Float64Type, Int16Type, Int32Type, Int64Type, Int8Type, IntoSeries, ListBooleanChunkedBuilder, + ListBuilderTrait, ListPrimitiveChunkedBuilder, ListStringChunkedBuilder, ListType, NamedFrom, + NewChunkedArray, ObjectType, PolarsError, Schema, SchemaExt, Series, StructChunked, + TemporalMethods, TimeUnit, UInt16Type, UInt32Type, UInt64Type, UInt8Type, }; use nu_protocol::{Record, ShellError, Span, Value}; @@ -146,6 +146,16 @@ impl DerefMut for TypedColumn { pub type ColumnMap = IndexMap; pub fn create_column( + column: &PolarsColumn, + from_row: usize, + to_row: usize, + span: Span, +) -> Result { + let series = column.as_materialized_series(); + create_column_from_series(series, from_row, to_row, span) +} + +pub fn create_column_from_series( series: &Series, from_row: usize, to_row: usize, @@ -497,15 +507,19 @@ fn typed_column_to_series(name: PlSmallStr, column: TypedColumn) -> Result Result = structs.into_values().collect(); - let chunked = - StructChunked::from_series(column.name().to_owned(), structs.as_slice()) - .map_err(|e| ShellError::GenericError { - error: format!("Error creating struct: {e}"), - msg: "".into(), - span: None, - help: None, - inner: vec![], - })?; + let chunked = StructChunked::from_series( + column.name().to_owned(), + structs.len(), + structs.iter(), + ) + .map_err(|e| ShellError::GenericError { + error: format!("Error creating struct: {e}"), + msg: "".into(), + span: None, + help: None, + inner: vec![], + })?; Ok(chunked.into_series()) } _ => Err(ShellError::GenericError { @@ -558,13 +575,13 @@ fn typed_column_to_series(name: PlSmallStr, column: TypedColumn) -> Result Result { - let mut df_series: Vec = Vec::new(); + let mut df_columns: Vec = Vec::new(); for (name, column) in column_values { let series = typed_column_to_series(name, column)?; - df_series.push(series); + df_columns.push(series.into()); } - DataFrame::new(df_series) + DataFrame::new(df_columns) .map(|df| NuDataFrame::new(false, df)) .map_err(|e| ShellError::GenericError { error: "Error creating dataframe".into(), @@ -1245,7 +1262,8 @@ fn any_value_to_value(any_value: &AnyValue, span: Span) -> Result { let nanos = nanos_from_timeunit(*a, *time_unit); - datetime_from_epoch_nanos(nanos, tz, span).map(|datetime| Value::date(datetime, span)) + datetime_from_epoch_nanos(nanos, &tz.cloned(), span) + .map(|datetime| Value::date(datetime, span)) } AnyValue::Duration(a, time_unit) => { let nanos = match time_unit { @@ -1264,17 +1282,7 @@ fn any_value_to_value(any_value: &AnyValue, span: Span) -> Result { // This should convert to a StructOwned object. - let static_value = - any_value - .clone() - .into_static() - .map_err(|e| ShellError::GenericError { - error: "Cannot convert polars struct to static value".into(), - msg: e.to_string(), - span: Some(span), - help: None, - inner: Vec::new(), - })?; + let static_value = any_value.clone().into_static(); any_value_to_value(&static_value, span) } AnyValue::StructOwned(struct_tuple) => { @@ -1485,7 +1493,7 @@ mod tests { let test_millis = 946_684_800_000; assert_eq!( any_value_to_value( - &AnyValue::Datetime(test_millis, TimeUnit::Milliseconds, &None), + &AnyValue::Datetime(test_millis, TimeUnit::Milliseconds, None), span )?, Value::date(comparison_date, span) @@ -1575,6 +1583,7 @@ mod tests { let test_bool_arr = BooleanArray::from([Some(true)]); let test_struct_arr = StructArray::new( DataType::Struct(fields.clone()).to_arrow(CompatLevel::newest()), + 1, vec![Box::new(test_int_arr), Box::new(test_bool_arr)], None, ); diff --git a/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/mod.rs b/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/mod.rs index 1848a69166..1138896d74 100644 --- a/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/mod.rs +++ b/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/mod.rs @@ -8,7 +8,9 @@ pub use operations::Axis; use indexmap::map::IndexMap; use nu_protocol::{did_you_mean, PipelineData, Record, ShellError, Span, Value}; -use polars::prelude::{DataFrame, DataType, IntoLazy, PolarsObject, Series}; +use polars::prelude::{ + Column as PolarsColumn, DataFrame, DataType, IntoLazy, PolarsObject, Series, +}; use polars_plan::prelude::{lit, Expr, Null}; use polars_utils::total_ord::{TotalEq, TotalHash}; use std::{ @@ -135,7 +137,7 @@ impl NuDataFrame { } pub fn try_from_series(series: Series, span: Span) -> Result { - match DataFrame::new(vec![series]) { + match DataFrame::new(vec![series.into()]) { Ok(dataframe) => Ok(NuDataFrame::new(false, dataframe)), Err(e) => Err(ShellError::GenericError { error: "Error creating dataframe".into(), @@ -191,13 +193,16 @@ impl NuDataFrame { } pub fn try_from_series_vec(columns: Vec, span: Span) -> Result { - let dataframe = DataFrame::new(columns).map_err(|e| ShellError::GenericError { - error: "Error creating dataframe".into(), - msg: format!("Unable to create DataFrame: {e}"), - span: Some(span), - help: None, - inner: vec![], - })?; + let columns_converted: Vec = columns.into_iter().map(Into::into).collect(); + + let dataframe = + DataFrame::new(columns_converted).map_err(|e| ShellError::GenericError { + error: "Error creating dataframe".into(), + msg: format!("Unable to create DataFrame: {e}"), + span: Some(span), + help: None, + inner: vec![], + })?; Ok(Self::new(false, dataframe)) } @@ -295,14 +300,15 @@ impl NuDataFrame { .df .get_columns() .first() - .expect("We have already checked that the width is 1"); + .expect("We have already checked that the width is 1") + .as_materialized_series(); Ok(series.clone()) } pub fn get_value(&self, row: usize, span: Span) -> Result { let series = self.as_series(span)?; - let column = conversion::create_column(&series, row, row + 1, span)?; + let column = conversion::create_column_from_series(&series, row, row + 1, span)?; if column.len() == 0 { Err(ShellError::AccessEmptyContent { span }) diff --git a/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/operations.rs b/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/operations.rs index 6e7590e2fc..11753f87ab 100644 --- a/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/operations.rs +++ b/crates/nu_plugin_polars/src/dataframe/values/nu_dataframe/operations.rs @@ -1,5 +1,5 @@ use nu_protocol::{ast::Operator, ShellError, Span, Spanned, Value}; -use polars::prelude::{DataFrame, Series}; +use polars::prelude::{Column as PolarsColumn, DataFrame}; use crate::values::CustomValueSupport; use crate::PolarsPlugin; @@ -137,7 +137,7 @@ impl NuDataFrame { series.rename(name.into()); series }) - .collect::>(); + .collect::>(); let df_new = DataFrame::new(new_cols).map_err(|e| ShellError::GenericError { error: "Error creating dataframe".into(), @@ -195,7 +195,7 @@ impl NuDataFrame { }), } }) - .collect::, ShellError>>()?; + .collect::, ShellError>>()?; let df_new = DataFrame::new(new_cols).map_err(|e| ShellError::GenericError { error: "Error appending dataframe".into(), diff --git a/crates/nu_plugin_polars/src/dataframe/values/nu_expression/mod.rs b/crates/nu_plugin_polars/src/dataframe/values/nu_expression/mod.rs index f0800c9ad2..7b60f9b1e4 100644 --- a/crates/nu_plugin_polars/src/dataframe/values/nu_expression/mod.rs +++ b/crates/nu_plugin_polars/src/dataframe/values/nu_expression/mod.rs @@ -215,12 +215,12 @@ pub fn expr_to_value(expr: &Expr, span: Span) -> Result { AggExpr::Quantile { expr, quantile, - interpol, + method, } => Ok(Value::record( record! { "expr" => expr_to_value(expr.as_ref(), span)?, "quantile" => expr_to_value(quantile.as_ref(), span)?, - "interpol" => Value::string(format!("{interpol:?}"), span), + "method" => Value::string(format!("{method:?}"), span), }, span, )),