From 422a36d2b82c57d65a339c9fff3249691d70cdbf Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Sat, 15 Jul 2023 10:34:45 -0700 Subject: [PATCH] Updated Polars to 0.31.1 --- CHANGELOG.md | 2 +- Cargo.lock | 560 +++++++++++++++++-------------- Cargo.toml | 2 - ext/polars/Cargo.toml | 6 +- ext/polars/src/apply/mod.rs | 10 +- ext/polars/src/conversion.rs | 24 +- ext/polars/src/dataframe.rs | 36 +- ext/polars/src/expr/general.rs | 38 ++- ext/polars/src/expr/string.rs | 8 +- ext/polars/src/functions/lazy.rs | 43 ++- ext/polars/src/lazyframe.rs | 14 +- ext/polars/src/lib.rs | 27 +- ext/polars/src/series.rs | 4 +- lib/polars/data_frame.rb | 22 +- lib/polars/expr.rb | 53 +-- lib/polars/lazy_frame.rb | 6 +- lib/polars/lazy_functions.rb | 28 +- lib/polars/list_expr.rb | 2 +- lib/polars/series.rb | 16 +- lib/polars/string_expr.rb | 4 +- lib/polars/utils.rb | 23 ++ 21 files changed, 532 insertions(+), 396 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e386a5921e..8c74caa2ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## 0.6.0 (unreleased) -- Updated Polars to 0.30.0 +- Updated Polars to 0.31.1 - Added `Array` type - Added support for creating series with `Datetime` type - Added support for `Null` to `to_a` method diff --git a/Cargo.lock b/Cargo.lock index 461855cf8e..c863f32361 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,15 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +dependencies = [ + "gimli", +] + [[package]] name = "adler" version = "1.0.2" @@ -28,9 +37,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" dependencies = [ "memchr", ] @@ -50,6 +59,12 @@ dependencies = [ "alloc-no-stdlib", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -86,9 +101,9 @@ dependencies = [ [[package]] name = "arrow2" -version = "0.17.2" +version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15ae0428d69ab31d7b2adad22a752d6f11fef2e901d2262d0cad4f5cb08b7093" +checksum = "e44f27e89e3edd8738a07c5e2c881efaa25e69be97a816d2df051685d460670c" dependencies = [ "ahash", "arrow-format", @@ -138,18 +153,18 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.26", ] [[package]] name = "async-trait" -version = "0.1.68" +version = "0.1.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.26", ] [[package]] @@ -181,6 +196,21 @@ dependencies = [ "snap", ] +[[package]] +name = "backtrace" +version = "0.3.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + [[package]] name = "base64" version = "0.21.2" @@ -257,7 +287,7 @@ checksum = "fdde5c9cd29ebd706ce1b35600920a33550e402fc998a2e53ad3b42c3c47a192" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.26", ] [[package]] @@ -308,9 +338,9 @@ dependencies = [ [[package]] name = "chrono-tz" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9cc2b23599e6d7479755f3594285efb3f74a1bdca7a7374948bc831e23a552" +checksum = "f1369bc6b9e9a7dfdae2055f6ec151fe9c554a9d23d357c0237cee2e25eaabb7" dependencies = [ "chrono", "chrono-tz-build", @@ -319,9 +349,9 @@ dependencies = [ [[package]] name = "chrono-tz-build" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9998fb9f7e9b2111641485bf8beb32f92945f97f92a3d061f744cfef335f751" +checksum = "e2f5ebdc942f57ed96d560a6d1a459bae5851102a25d5bf89dc04ae453e31ecf" dependencies = [ "parse-zoneinfo", "phf", @@ -341,13 +371,13 @@ dependencies = [ [[package]] name = "comfy-table" -version = "6.2.0" +version = "7.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e959d788268e3bf9d35ace83e81b124190378e4c91c9067524675e33394b8ba" +checksum = "9ab77dbd8adecaf3f0db40581631b995f312a8a5ae3aa9993188bb8f23d83a5b" dependencies = [ "crossterm", "strum", - "strum_macros", + "strum_macros 0.24.3", "unicode-width", ] @@ -404,9 +434,9 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.14" +version = "0.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ "autocfg", "cfg-if", @@ -427,9 +457,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.15" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ "cfg-if", ] @@ -452,9 +482,9 @@ dependencies = [ [[package]] name = "crossterm_winapi" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ae1b35a484aa10e07fe0638d02301c5ad24de82d310ccbd2f3693da5f09bf1c" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" dependencies = [ "winapi", ] @@ -473,16 +503,22 @@ checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "enum_dispatch" -version = "0.3.11" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11f36e95862220b211a6e2aa5eca09b4fa391b13cd52ceb8035a24bf65a79de2" +checksum = "8f33313078bb8d4d05a2733a94ac4c2d8a0df9a2b84424ebf4f33bfc224a890e" dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.26", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "ethnum" version = "1.3.2" @@ -582,7 +618,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.26", ] [[package]] @@ -617,9 +653,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", "js-sys", @@ -628,6 +664,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "gimli" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" + [[package]] name = "glob" version = "0.3.1" @@ -636,9 +678,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "halfbrown" -version = "0.2.2" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f985624e90f861184145c13b736873a0f83cdb998a292dbb0653598ab03aecbf" +checksum = "5681137554ddff44396e5f149892c769d45301dd9aa19c51602a89ee214cb0ec" dependencies = [ "hashbrown 0.13.2", "serde", @@ -652,17 +694,21 @@ checksum = "74721d007512d0cb3338cd20f0654ac913920061a4c4d0d8708edb3f2a698c0c" [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" dependencies = [ "ahash", + "allocator-api2", "rayon", ] @@ -674,12 +720,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.2.6" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] name = "hex" @@ -693,14 +736,14 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys", ] [[package]] name = "iana-time-zone" -version = "0.1.56" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -721,12 +764,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.3" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" dependencies = [ - "autocfg", - "hashbrown 0.12.3", + "equivalent", + "hashbrown 0.14.0", "serde", ] @@ -741,9 +784,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" [[package]] name = "itoap" @@ -782,9 +825,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.63" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] @@ -792,7 +835,7 @@ dependencies = [ [[package]] name = "jsonpath_lib" version = "0.3.0" -source = "git+https://github.com/ritchie46/jsonpath?branch=improve_compiled#24eaf0b4416edff38a4d1b6b17bc4b9f3f047b4b" +source = "git+https://github.com/ritchie46/jsonpath?rev=24eaf0b4416edff38a4d1b6b17bc4b9f3f047b4b#24eaf0b4416edff38a4d1b6b17bc4b9f3f047b4b" dependencies = [ "log", "serde", @@ -886,9 +929,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.144" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libflate" @@ -938,9 +981,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" dependencies = [ "autocfg", "scopeguard", @@ -948,9 +991,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.18" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de" +checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" [[package]] name = "lz4" @@ -974,9 +1017,9 @@ dependencies = [ [[package]] name = "magnus" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8dc14463c2552e753ef562961f486ca76f17a857c121db40e9f3ade3f35ab81" +checksum = "b560c3c0284c9ec7c30b7ba823896387423225add3f107213a794b73853c7505" dependencies = [ "magnus-macros", "rb-sys", @@ -1011,9 +1054,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" dependencies = [ "autocfg", ] @@ -1044,14 +1087,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eebffdb73fe72e917997fad08bdbf31ac50b0fa91cec93e69a0662e4264d454c" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -1126,19 +1169,28 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ "hermit-abi", "libc", ] +[[package]] +name = "object" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" -version = "1.17.2" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "parking_lot" @@ -1158,7 +1210,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.7", + "parking_lot_core 0.9.8", ] [[package]] @@ -1170,22 +1222,22 @@ dependencies = [ "cfg-if", "instant", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec", "winapi", ] [[package]] name = "parking_lot_core" -version = "0.9.7" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.3.5", "smallvec", - "windows-sys 0.45.0", + "windows-targets", ] [[package]] @@ -1233,18 +1285,18 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "phf" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ "phf_shared", ] [[package]] name = "phf_codegen" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56ac890c5e3ca598bbdeaa99964edb5b0258a583a9eb6ef4e89fc85d9224770" +checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" dependencies = [ "phf_generator", "phf_shared", @@ -1252,9 +1304,9 @@ dependencies = [ [[package]] name = "phf_generator" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1181c94580fa345f50f19d738aaa39c0ed30a600d95cb2d3e23f94266f14fbf" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ "phf_shared", "rand", @@ -1262,18 +1314,18 @@ dependencies = [ [[package]] name = "phf_shared" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" dependencies = [ "siphasher", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" [[package]] name = "pin-utils" @@ -1305,7 +1357,7 @@ dependencies = [ "jemallocator", "magnus", "mimalloc", - "polars 0.30.0", + "polars 0.31.1", "polars-core", "serde_json", "smartstring", @@ -1313,8 +1365,9 @@ dependencies = [ [[package]] name = "polars" -version = "0.30.0" -source = "git+https://github.com/pola-rs/polars?rev=2173efc1c52d42429975c0106587366a5362de0b#2173efc1c52d42429975c0106587366a5362de0b" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e072ca6b1c26e686b18d86b607a17b1f8baa5fb0a713a1fefe033f0aa527bfd" dependencies = [ "getrandom", "polars-core", @@ -1328,14 +1381,16 @@ dependencies = [ [[package]] name = "polars-arrow" -version = "0.30.0" -source = "git+https://github.com/pola-rs/polars?rev=2173efc1c52d42429975c0106587366a5362de0b#2173efc1c52d42429975c0106587366a5362de0b" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52f7b885c589dd7184c881be3dfb149feb1f405083fdd2fd9194e8f96104b76" dependencies = [ "arrow2", "atoi", "chrono", "chrono-tz", - "hashbrown 0.13.2", + "ethnum", + "hashbrown 0.14.0", "multiversion", "num-traits", "polars-error", @@ -1345,8 +1400,9 @@ dependencies = [ [[package]] name = "polars-core" -version = "0.30.0" -source = "git+https://github.com/pola-rs/polars?rev=2173efc1c52d42429975c0106587366a5362de0b#2173efc1c52d42429975c0106587366a5362de0b" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f98d6b1ef5362f76063b4984634d371de72f4834f50892944d48fd7b7d5ae45" dependencies = [ "ahash", "arrow2", @@ -1355,7 +1411,7 @@ dependencies = [ "chrono-tz", "comfy-table", "either", - "hashbrown 0.13.2", + "hashbrown 0.14.0", "indexmap", "itoap", "num-traits", @@ -1378,8 +1434,9 @@ dependencies = [ [[package]] name = "polars-error" -version = "0.30.0" -source = "git+https://github.com/pola-rs/polars?rev=2173efc1c52d42429975c0106587366a5362de0b#2173efc1c52d42429975c0106587366a5362de0b" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1557cd24b1865194bac6979765cfec5e97ecd8af5dcb7858a17b31d1e7fbf70" dependencies = [ "arrow2", "regex", @@ -1388,8 +1445,9 @@ dependencies = [ [[package]] name = "polars-io" -version = "0.30.0" -source = "git+https://github.com/pola-rs/polars?rev=2173efc1c52d42429975c0106587366a5362de0b#2173efc1c52d42429975c0106587366a5362de0b" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c44b1c6d7b2c04e459effb93bac050f90762687cb752c534967476c452478a65" dependencies = [ "ahash", "arrow2", @@ -1423,13 +1481,14 @@ dependencies = [ [[package]] name = "polars-json" -version = "0.30.0" -source = "git+https://github.com/pola-rs/polars?rev=2173efc1c52d42429975c0106587366a5362de0b#2173efc1c52d42429975c0106587366a5362de0b" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eef6b83136b3884ce356ed74b58eeedc81d81b981e901fbd15f16c96a5ff315" dependencies = [ "ahash", "arrow2", "fallible-streaming-iterator", - "hashbrown 0.13.2", + "hashbrown 0.14.0", "indexmap", "num-traits", "polars-arrow", @@ -1440,8 +1499,9 @@ dependencies = [ [[package]] name = "polars-lazy" -version = "0.30.0" -source = "git+https://github.com/pola-rs/polars?rev=2173efc1c52d42429975c0106587366a5362de0b#2173efc1c52d42429975c0106587366a5362de0b" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "494f1e75a035978339b06bdcc4d60523ec347243ac65f11794a7eeaba0507d4e" dependencies = [ "ahash", "bitflags", @@ -1462,14 +1522,16 @@ dependencies = [ [[package]] name = "polars-ops" -version = "0.30.0" -source = "git+https://github.com/pola-rs/polars?rev=2173efc1c52d42429975c0106587366a5362de0b#2173efc1c52d42429975c0106587366a5362de0b" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06dd95bc84a7bf17886670420097c5fb8b88906ebb16653153ce5f0cf71ffd6e" dependencies = [ "argminmax", "arrow2", "base64", "either", "hex", + "indexmap", "jsonpath_lib", "memchr", "polars-arrow", @@ -1483,13 +1545,14 @@ dependencies = [ [[package]] name = "polars-pipe" -version = "0.30.0" -source = "git+https://github.com/pola-rs/polars?rev=2173efc1c52d42429975c0106587366a5362de0b#2173efc1c52d42429975c0106587366a5362de0b" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff34c8f09c064ab26bc9283c13b6a1571083c30c4c3812301cd84cdd3982a2e0" dependencies = [ "crossbeam-channel", "crossbeam-queue", "enum_dispatch", - "hashbrown 0.13.2", + "hashbrown 0.14.0", "num-traits", "polars-arrow", "polars-core", @@ -1504,8 +1567,9 @@ dependencies = [ [[package]] name = "polars-plan" -version = "0.30.0" -source = "git+https://github.com/pola-rs/polars?rev=2173efc1c52d42429975c0106587366a5362de0b#2173efc1c52d42429975c0106587366a5362de0b" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58f0837dac2b7064e04a2a37a2bff20f75a455d23b29f2dd82f0345de62d3bfb" dependencies = [ "ahash", "arrow2", @@ -1522,12 +1586,14 @@ dependencies = [ "regex", "serde", "smartstring", + "strum_macros 0.25.1", ] [[package]] name = "polars-row" -version = "0.30.0" -source = "git+https://github.com/pola-rs/polars?rev=2173efc1c52d42429975c0106587366a5362de0b#2173efc1c52d42429975c0106587366a5362de0b" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46235f6f67005fff3fd8095b994e86f846b5affd6fc6f36f41099a4dbc27d714" dependencies = [ "arrow2", "polars-error", @@ -1536,8 +1602,9 @@ dependencies = [ [[package]] name = "polars-sql" -version = "0.30.0" -source = "git+https://github.com/pola-rs/polars?rev=2173efc1c52d42429975c0106587366a5362de0b#2173efc1c52d42429975c0106587366a5362de0b" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7f716671c8e8ed1db6ebdbfcc7ca0c98a599e92c340747c24072b86e8839bed" dependencies = [ "polars-arrow", "polars-core", @@ -1550,8 +1617,9 @@ dependencies = [ [[package]] name = "polars-time" -version = "0.30.0" -source = "git+https://github.com/pola-rs/polars?rev=2173efc1c52d42429975c0106587366a5362de0b#2173efc1c52d42429975c0106587366a5362de0b" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02488938edfbff6efed56a4f90ebd6574ea16a7d32b6dc678134624031f7f3e9" dependencies = [ "arrow2", "atoi", @@ -1570,11 +1638,13 @@ dependencies = [ [[package]] name = "polars-utils" -version = "0.30.0" -source = "git+https://github.com/pola-rs/polars?rev=2173efc1c52d42429975c0106587366a5362de0b#2173efc1c52d42429975c0106587366a5362de0b" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69f04f6c127b8d20292b4d49b5fb0e47c652875b316274f74f52e77d50f6a459" dependencies = [ "ahash", - "hashbrown 0.13.2", + "hashbrown 0.14.0", + "num-traits", "once_cell", "rayon", "smartstring", @@ -1589,18 +1659,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.59" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" +checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.28" +version = "1.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" dependencies = [ "proc-macro2", ] @@ -1669,18 +1739,18 @@ dependencies = [ [[package]] name = "rb-sys" -version = "0.9.78" +version = "0.9.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91447d8cbb45afb5c915bad4dd44bd4b4e9be37648122409ceca75302cb81683" +checksum = "939fb78db3e4f26665c1d4c7b91ca66d3578335a19aba552d4a6445811d07072" dependencies = [ "rb-sys-build", ] [[package]] name = "rb-sys-build" -version = "0.9.78" +version = "0.9.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20673c1cfbd57b2db6c066b796352f07d241c45b210fd15b269dec54fa240380" +checksum = "335a95eb0420d52fa94ef12019df3c2c250c6b19cbb3c60bd05cb7e9c362072c" dependencies = [ "bindgen", "lazy_static", @@ -1706,15 +1776,36 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", +] + [[package]] name = "regex" -version = "1.8.3" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81ca098a9821bd52d6b24fd8b10bd081f47d39c22778cafaa75a2857a62c6390" +checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.2", + "regex-automata", + "regex-syntax 0.7.4", +] + +[[package]] +name = "regex-automata" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.7.4", ] [[package]] @@ -1725,9 +1816,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "rle-decode-fast" @@ -1735,6 +1826,12 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3582f63211428f83597b51b2ddb88e2a91a9d52d12831f9d08f5e624e8977422" +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + [[package]] name = "rustc-hash" version = "1.1.0" @@ -1752,15 +1849,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" +checksum = "dc31bd9b61a32c31f9650d18add92aa83a49ba979c143eefd27fe7177b05bd5f" [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" [[package]] name = "scopeguard" @@ -1776,35 +1873,35 @@ checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" [[package]] name = "seq-macro" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6b44e8fc93a14e66336d230954dda83d18b4605ccace8fe09bc7514a71ad0bc" +checksum = "63134939175b3131fe4d2c131b103fd42f25ccca89423d43b5e4f267920ccf03" [[package]] name = "serde" -version = "1.0.163" +version = "1.0.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.163" +version = "1.0.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.26", ] [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "b5062a995d481b2308b6064e9af76011f2921c35f97b0468811ed9f6cd91dfed" dependencies = [ "indexmap", "itoa", @@ -1826,9 +1923,9 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "signal-hook" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "732768f1176d21d09e076c23a93123d40bba92d50c4058da34d45c8de8e682b9" +checksum = "b824b6e687aff278cdbf3b36f07aa52d4bd4099699324d5da86a2ebce3aa00b3" dependencies = [ "libc", "signal-hook-registry", @@ -1893,9 +1990,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "smartstring" @@ -1980,6 +2077,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "strum_macros" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6069ca09d878a33f883cc06aaa9718ede171841d3832450354410b718b097232" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.26", +] + [[package]] name = "syn" version = "1.0.109" @@ -1993,9 +2103,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.18" +version = "2.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "45c3457aacde3c65315de5031ec191ce46604304d2446e803d71ade03308d970" dependencies = [ "proc-macro2", "quote", @@ -2004,9 +2114,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.29.0" +version = "0.29.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02f1dc6930a439cc5d154221b5387d153f8183529b07c19aca24ea31e0a167e1" +checksum = "751e810399bba86e9326f5762b7f32ac5a085542df78da6a78d94e07d14d7c11" dependencies = [ "cfg-if", "core-foundation-sys", @@ -2024,22 +2134,22 @@ checksum = "06f6b473c37f9add4cf1df5b4d66a8ef58ab6c895f1a3b3f949cf3e21230140e" [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.26", ] [[package]] @@ -2055,23 +2165,24 @@ dependencies = [ [[package]] name = "tokio" -version = "1.28.2" +version = "1.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" +checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" dependencies = [ "autocfg", + "backtrace", "libc", "mio", "pin-project-lite", "socket2", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-width" @@ -2111,9 +2222,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2121,24 +2232,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.26", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.36" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ "cfg-if", "js-sys", @@ -2148,9 +2259,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2158,22 +2269,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.26", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-timer" @@ -2192,9 +2303,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.63" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" dependencies = [ "js-sys", "wasm-bindgen", @@ -2228,16 +2339,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.48.0", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", + "windows-targets", ] [[package]] @@ -2246,117 +2348,60 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.0", -] - -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows-targets", ] [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.48.0" @@ -2398,8 +2443,3 @@ dependencies = [ "libc", "pkg-config", ] - -[[patch.unused]] -name = "jsonpath_lib" -version = "0.3.0" -source = "git+https://github.com/ritchie46/jsonpath?rev=24eaf0b4416edff38a4d1b6b17bc4b9f3f047b4b#24eaf0b4416edff38a4d1b6b17bc4b9f3f047b4b" diff --git a/Cargo.toml b/Cargo.toml index 575e051177..10341b01bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,8 +3,6 @@ members = ["ext/polars"] [patch.crates-io] jsonpath_lib = { git = "https://github.com/ritchie46/jsonpath", rev = "24eaf0b4416edff38a4d1b6b17bc4b9f3f047b4b" } -polars = { version = "0.30.0", git = "https://github.com/pola-rs/polars", rev = "2173efc1c52d42429975c0106587366a5362de0b" } -polars-core = { version = "0.30.0", git = "https://github.com/pola-rs/polars", rev = "2173efc1c52d42429975c0106587366a5362de0b" } [profile.release] strip = true diff --git a/ext/polars/Cargo.toml b/ext/polars/Cargo.toml index 8d96876e51..3a1d099ce4 100644 --- a/ext/polars/Cargo.toml +++ b/ext/polars/Cargo.toml @@ -13,16 +13,15 @@ crate-type = ["cdylib"] ahash = "0.8" chrono = "=0.4.24" magnus = "0.5" -polars-core = "0.30.0" +polars-core = "0.31.1" serde_json = "1" smartstring = "1" [dependencies.polars] -version = "0.30.0" +version = "0.31.1" features = [ "abs", "approx_unique", - "arange", "arg_where", "asof_join", "avro", @@ -69,6 +68,7 @@ features = [ "propagate_nans", "random", "rank", + "range", "reinterpret", "repeat_by", "rolling_window", diff --git a/ext/polars/src/apply/mod.rs b/ext/polars/src/apply/mod.rs index ad0296630e..07b02addce 100644 --- a/ext/polars/src/apply/mod.rs +++ b/ext/polars/src/apply/mod.rs @@ -237,15 +237,19 @@ fn iterator_to_list( for _ in 0..init_null_count { builder.append_null() } - builder.append_opt_series(first_value); + builder + .append_opt_series(first_value) + .map_err(RbPolarsErr::from)?; for opt_val in it { match opt_val { None => builder.append_null(), Some(s) => { if s.len() == 0 && s.dtype() != dt { - builder.append_series(&Series::full_null("", 0, dt)) + builder + .append_series(&Series::full_null("", 0, dt)) + .unwrap() } else { - builder.append_series(&s) + builder.append_series(&s).map_err(RbPolarsErr::from)? } } } diff --git a/ext/polars/src/conversion.rs b/ext/polars/src/conversion.rs index 470e6bf51a..bd3665cf06 100644 --- a/ext/polars/src/conversion.rs +++ b/ext/polars/src/conversion.rs @@ -543,13 +543,23 @@ impl<'s> TryConvert for Wrap> { if v.is_empty() { Ok(Wrap(AnyValue::List(Series::new_empty("", &DataType::Null)))) } else { - let avs = v.try_convert::>()?.0 .0; - // use first `n` values to infer datatype - // this value is not too large as this will be done with every - // anyvalue that has to be converted, which can be many - let n = 25; - let dtype = any_values_to_dtype(&avs[..std::cmp::min(avs.len(), n)]) - .map_err(RbPolarsErr::from)?; + let list = v; + + let mut avs = Vec::with_capacity(25); + let mut iter = list.each(); + + for item in (&mut iter).take(25) { + avs.push(item?.try_convert::>()?.0) + } + + let (dtype, _n_types) = any_values_to_dtype(&avs).map_err(RbPolarsErr::from)?; + + // push the rest + avs.reserve(list.len()); + for item in iter { + avs.push(item?.try_convert::>()?.0) + } + let s = Series::from_any_values_and_dtype("", &avs, &dtype, true) .map_err(RbPolarsErr::from)?; Ok(Wrap(AnyValue::List(s))) diff --git a/ext/polars/src/dataframe.rs b/ext/polars/src/dataframe.rs index ae32ec6313..c9ebb51fa0 100644 --- a/ext/polars/src/dataframe.rs +++ b/ext/polars/src/dataframe.rs @@ -796,22 +796,6 @@ impl RbDataFrame { Ok(RbDataFrame::new(df)) } - pub fn sort(&self, by_column: String, reverse: bool, nulls_last: bool) -> RbResult { - let df = self - .df - .borrow() - .sort_with_options( - &by_column, - SortOptions { - descending: reverse, - nulls_last, - multithreaded: true, - }, - ) - .map_err(RbPolarsErr::from)?; - Ok(RbDataFrame::new(df)) - } - pub fn replace(&self, column: String, new_col: &RbSeries) -> RbResult<()> { self.df .borrow_mut() @@ -935,11 +919,16 @@ impl RbDataFrame { Ok(RbDataFrame::new(df)) } - pub fn partition_by(&self, groups: Vec, stable: bool) -> RbResult { - let out = if stable { - self.df.borrow().partition_by_stable(groups) + pub fn partition_by( + &self, + by: Vec, + maintain_order: bool, + include_key: bool, + ) -> RbResult { + let out = if maintain_order { + self.df.borrow().partition_by_stable(by, include_key) } else { - self.df.borrow().partition_by(groups) + self.df.borrow().partition_by(by, include_key) } .map_err(RbPolarsErr::from)?; Ok(RArray::from_iter(out.into_iter().map(RbDataFrame::new))) @@ -1026,13 +1015,18 @@ impl RbDataFrame { &self, columns: Option>, separator: Option, + drop_first: bool, ) -> RbResult { let df = match columns { Some(cols) => self.df.borrow().columns_to_dummies( cols.iter().map(|x| x as &str).collect(), separator.as_deref(), + drop_first, ), - None => self.df.borrow().to_dummies(separator.as_deref()), + None => self + .df + .borrow() + .to_dummies(separator.as_deref(), drop_first), } .map_err(RbPolarsErr::from)?; Ok(df.into()) diff --git a/ext/polars/src/expr/general.rs b/ext/polars/src/expr/general.rs index 139a95dfe0..425f212d4b 100644 --- a/ext/polars/src/expr/general.rs +++ b/ext/polars/src/expr/general.rs @@ -3,6 +3,7 @@ use polars::lazy::dsl; use polars::prelude::*; use polars::series::ops::NullBehavior; use polars_core::series::IsSorted; +use std::any::Any; use crate::apply::lazy::map_single; use crate::conversion::{parse_fill_null_strategy, Wrap}; @@ -202,6 +203,7 @@ impl RbExpr { descending, nulls_last, multithreaded: true, + maintain_order: false, }) .into() } @@ -213,6 +215,7 @@ impl RbExpr { descending: reverse, nulls_last, multithreaded: true, + maintain_order: false, }) .into() } @@ -589,6 +592,7 @@ impl RbExpr { center, by, closed_window: closed.map(|c| c.0), + ..Default::default() }; self.inner.clone().rolling_sum(options).into() } @@ -609,6 +613,7 @@ impl RbExpr { center, by, closed_window: closed.map(|c| c.0), + ..Default::default() }; self.inner.clone().rolling_min(options).into() } @@ -629,6 +634,7 @@ impl RbExpr { center, by, closed_window: closed.map(|c| c.0), + ..Default::default() }; self.inner.clone().rolling_max(options).into() } @@ -649,11 +655,13 @@ impl RbExpr { center, by, closed_window: closed.map(|c| c.0), + ..Default::default() }; self.inner.clone().rolling_mean(options).into() } + #[allow(clippy::too_many_arguments)] pub fn rolling_std( &self, window_size: String, @@ -662,6 +670,7 @@ impl RbExpr { center: bool, by: Option, closed: Option>, + ddof: u8, ) -> Self { let options = RollingOptions { window_size: Duration::parse(&window_size), @@ -670,11 +679,13 @@ impl RbExpr { center, by, closed_window: closed.map(|c| c.0), + fn_params: Some(Arc::new(RollingVarParams { ddof }) as Arc), }; self.inner.clone().rolling_std(options).into() } + #[allow(clippy::too_many_arguments)] pub fn rolling_var( &self, window_size: String, @@ -683,6 +694,7 @@ impl RbExpr { center: bool, by: Option, closed: Option>, + ddof: u8, ) -> Self { let options = RollingOptions { window_size: Duration::parse(&window_size), @@ -691,6 +703,7 @@ impl RbExpr { center, by, closed_window: closed.map(|c| c.0), + fn_params: Some(Arc::new(RollingVarParams { ddof }) as Arc), }; self.inner.clone().rolling_var(options).into() @@ -712,8 +725,12 @@ impl RbExpr { center, by, closed_window: closed.map(|c| c.0), + fn_params: Some(Arc::new(RollingQuantileParams { + prob: 0.5, + interpol: QuantileInterpolOptions::Linear, + }) as Arc), }; - self.inner.clone().rolling_median(options).into() + self.inner.clone().rolling_quantile(options).into() } #[allow(clippy::too_many_arguments)] @@ -735,12 +752,13 @@ impl RbExpr { center, by, closed_window: closed.map(|c| c.0), + fn_params: Some(Arc::new(RollingQuantileParams { + prob: quantile, + interpol: interpolation.0, + }) as Arc), }; - self.inner - .clone() - .rolling_quantile(quantile, interpolation.0, options) - .into() + self.inner.clone().rolling_quantile(options).into() } pub fn rolling_skew(&self, window_size: usize, bias: bool) -> Self { @@ -810,8 +828,8 @@ impl RbExpr { .into() } - pub fn shuffle(&self, seed: Option) -> Self { - self.inner.clone().shuffle(seed).into() + pub fn shuffle(&self, seed: Option, fixed_seed: bool) -> Self { + self.inner.clone().shuffle(seed, fixed_seed).into() } pub fn sample_n( @@ -820,10 +838,11 @@ impl RbExpr { with_replacement: bool, shuffle: bool, seed: Option, + fixed_seed: bool, ) -> Self { self.inner .clone() - .sample_n(n, with_replacement, shuffle, seed) + .sample_n(n, with_replacement, shuffle, seed, fixed_seed) .into() } @@ -833,10 +852,11 @@ impl RbExpr { with_replacement: bool, shuffle: bool, seed: Option, + fixed_seed: bool, ) -> Self { self.inner .clone() - .sample_frac(frac, with_replacement, shuffle, seed) + .sample_frac(frac, with_replacement, shuffle, seed, fixed_seed) .into() } diff --git a/ext/polars/src/expr/string.rs b/ext/polars/src/expr/string.rs index fae5ba12f8..ff7f9aa937 100644 --- a/ext/polars/src/expr/string.rs +++ b/ext/polars/src/expr/string.rs @@ -230,7 +230,11 @@ impl RbExpr { .into() } - pub fn str_json_extract(&self, dtype: Option>) -> Self { + pub fn str_json_extract( + &self, + dtype: Option>, + infer_schema_len: Option, + ) -> Self { let dtype = dtype.map(|wrap| wrap.0); let output_type = match dtype.clone() { @@ -240,7 +244,7 @@ impl RbExpr { let function = move |s: Series| { let ca = s.utf8()?; - match ca.json_extract(dtype.clone()) { + match ca.json_extract(dtype.clone(), infer_schema_len) { Ok(ca) => Ok(Some(ca.into_series())), Err(e) => Err(PolarsError::ComputeError(format!("{e:?}").into())), } diff --git a/ext/polars/src/functions/lazy.rs b/ext/polars/src/functions/lazy.rs index badc8bf09a..f982272556 100644 --- a/ext/polars/src/functions/lazy.rs +++ b/ext/polars/src/functions/lazy.rs @@ -58,7 +58,12 @@ pub fn cols(names: Vec) -> RbExpr { dsl::cols(names).into() } -pub fn concat_lf(lfs: Value, rechunk: bool, parallel: bool) -> RbResult { +pub fn concat_lf( + lfs: Value, + rechunk: bool, + parallel: bool, + to_supertypes: bool, +) -> RbResult { let (seq, len) = get_rbseq(lfs)?; let mut lfs = Vec::with_capacity(len); @@ -68,7 +73,15 @@ pub fn concat_lf(lfs: Value, rechunk: bool, parallel: bool) -> RbResult RbResult { } } -pub fn repeat(value: Value, n_times: &RbExpr) -> RbResult { - if value.is_nil() { - Ok(polars::lazy::dsl::repeat(Null {}, n_times.inner.clone()).into()) - } else { - todo!(); +pub fn repeat(value: &RbExpr, n: &RbExpr, dtype: Option>) -> RbResult { + let mut value = value.inner.clone(); + let n = n.inner.clone(); + + if let Some(dtype) = dtype { + value = value.cast(dtype.0); + } + + if let Expr::Literal(lv) = &value { + let av = lv.to_anyvalue().unwrap(); + // Integer inputs that fit in Int32 are parsed as such + if let DataType::Int64 = av.dtype() { + let int_value = av.try_extract::().unwrap(); + if int_value >= i32::MIN as i64 && int_value <= i32::MAX as i64 { + value = value.cast(DataType::Int32); + } + } } + Ok(dsl::repeat(value, n).into()) } pub fn pearson_corr(a: &RbExpr, b: &RbExpr, ddof: u8) -> RbExpr { @@ -216,7 +242,8 @@ pub fn dtype_cols2(dtypes: RArray) -> RbResult { Ok(crate::functions::lazy::dtype_cols(dtypes)) } +// TODO rename to sum_horizontal pub fn sum_exprs(exprs: RArray) -> RbResult { let exprs = rb_exprs_to_exprs(exprs)?; - Ok(polars::lazy::dsl::sum_exprs(exprs).into()) + Ok(polars::lazy::dsl::sum_horizontal(exprs).into()) } diff --git a/ext/polars/src/lazyframe.rs b/ext/polars/src/lazyframe.rs index e3ba3bae90..241b8b7f1b 100644 --- a/ext/polars/src/lazyframe.rs +++ b/ext/polars/src/lazyframe.rs @@ -230,7 +230,13 @@ impl RbLazyFrame { ldf.into() } - pub fn sort(&self, by_column: String, reverse: bool, nulls_last: bool) -> Self { + pub fn sort( + &self, + by_column: String, + reverse: bool, + nulls_last: bool, + maintain_order: bool, + ) -> Self { let ldf = self.ldf.clone(); ldf.sort( &by_column, @@ -238,6 +244,7 @@ impl RbLazyFrame { descending: reverse, nulls_last, multithreaded: true, + maintain_order, }, ) .into() @@ -248,10 +255,13 @@ impl RbLazyFrame { by_column: RArray, reverse: Vec, nulls_last: bool, + maintain_order: bool, ) -> RbResult { let ldf = self.ldf.clone(); let exprs = rb_exprs_to_exprs(by_column)?; - Ok(ldf.sort_by_exprs(exprs, reverse, nulls_last).into()) + Ok(ldf + .sort_by_exprs(exprs, reverse, nulls_last, maintain_order) + .into()) } pub fn cache(&self) -> Self { diff --git a/ext/polars/src/lib.rs b/ext/polars/src/lib.rs index 4e4254a203..c41d859b9e 100644 --- a/ext/polars/src/lib.rs +++ b/ext/polars/src/lib.rs @@ -59,7 +59,7 @@ fn init() -> RbResult<()> { )?; module.define_singleton_method( "_concat_lf", - function!(crate::functions::lazy::concat_lf, 3), + function!(crate::functions::lazy::concat_lf, 4), )?; module.define_singleton_method( "_diag_concat_df", @@ -179,7 +179,6 @@ fn init() -> RbResult<()> { "take_with_series", method!(RbDataFrame::take_with_series, 1), )?; - class.define_method("sort", method!(RbDataFrame::sort, 3))?; class.define_method("replace", method!(RbDataFrame::replace, 2))?; class.define_method("replace_at_idx", method!(RbDataFrame::replace_at_idx, 2))?; class.define_method("insert_at_idx", method!(RbDataFrame::insert_at_idx, 2))?; @@ -193,7 +192,7 @@ fn init() -> RbResult<()> { class.define_method("_clone", method!(RbDataFrame::clone, 0))?; class.define_method("melt", method!(RbDataFrame::melt, 4))?; class.define_method("pivot_expr", method!(RbDataFrame::pivot_expr, 7))?; - class.define_method("partition_by", method!(RbDataFrame::partition_by, 2))?; + class.define_method("partition_by", method!(RbDataFrame::partition_by, 3))?; class.define_method("shift", method!(RbDataFrame::shift, 1))?; class.define_method("lazy", method!(RbDataFrame::lazy, 0))?; class.define_method("max", method!(RbDataFrame::max, 0))?; @@ -208,7 +207,7 @@ fn init() -> RbResult<()> { class.define_method("hmin", method!(RbDataFrame::hmin, 0))?; class.define_method("hsum", method!(RbDataFrame::hsum, 1))?; class.define_method("quantile", method!(RbDataFrame::quantile, 2))?; - class.define_method("to_dummies", method!(RbDataFrame::to_dummies, 2))?; + class.define_method("to_dummies", method!(RbDataFrame::to_dummies, 3))?; class.define_method("null_count", method!(RbDataFrame::null_count, 0))?; class.define_method("apply", method!(RbDataFrame::apply, 3))?; class.define_method("shrink_to_fit", method!(RbDataFrame::shrink_to_fit, 0))?; @@ -361,7 +360,7 @@ fn init() -> RbResult<()> { class.define_method("str_base64_encode", method!(RbExpr::str_base64_encode, 0))?; class.define_method("str_base64_decode", method!(RbExpr::str_base64_decode, 1))?; class.define_method("str_parse_int", method!(RbExpr::str_parse_int, 2))?; - class.define_method("str_json_extract", method!(RbExpr::str_json_extract, 1))?; + class.define_method("str_json_extract", method!(RbExpr::str_json_extract, 2))?; class.define_method("binary_hex_encode", method!(RbExpr::bin_hex_encode, 0))?; class.define_method("binary_hex_decode", method!(RbExpr::bin_hex_decode, 1))?; class.define_method( @@ -461,8 +460,8 @@ fn init() -> RbResult<()> { class.define_method("rolling_min", method!(RbExpr::rolling_min, 6))?; class.define_method("rolling_max", method!(RbExpr::rolling_max, 6))?; class.define_method("rolling_mean", method!(RbExpr::rolling_mean, 6))?; - class.define_method("rolling_std", method!(RbExpr::rolling_std, 6))?; - class.define_method("rolling_var", method!(RbExpr::rolling_var, 6))?; + class.define_method("rolling_std", method!(RbExpr::rolling_std, 7))?; + class.define_method("rolling_var", method!(RbExpr::rolling_var, 7))?; class.define_method("rolling_median", method!(RbExpr::rolling_median, 6))?; class.define_method("rolling_quantile", method!(RbExpr::rolling_quantile, 8))?; class.define_method("rolling_skew", method!(RbExpr::rolling_skew, 2))?; @@ -496,9 +495,9 @@ fn init() -> RbResult<()> { class.define_method("reshape", method!(RbExpr::reshape, 1))?; class.define_method("cumcount", method!(RbExpr::cumcount, 1))?; class.define_method("to_physical", method!(RbExpr::to_physical, 0))?; - class.define_method("shuffle", method!(RbExpr::shuffle, 1))?; - class.define_method("sample_n", method!(RbExpr::sample_n, 4))?; - class.define_method("sample_frac", method!(RbExpr::sample_frac, 4))?; + class.define_method("shuffle", method!(RbExpr::shuffle, 2))?; + class.define_method("sample_n", method!(RbExpr::sample_n, 5))?; + class.define_method("sample_frac", method!(RbExpr::sample_frac, 5))?; class.define_method("ewm_mean", method!(RbExpr::ewm_mean, 4))?; class.define_method("ewm_std", method!(RbExpr::ewm_std, 5))?; class.define_method("ewm_var", method!(RbExpr::ewm_var, 5))?; @@ -548,7 +547,7 @@ fn init() -> RbResult<()> { class.define_singleton_method("cumfold", function!(crate::functions::lazy::cumfold, 4))?; class.define_singleton_method("lit", function!(crate::functions::lazy::lit, 2))?; class.define_singleton_method("arange", function!(crate::functions::lazy::arange, 3))?; - class.define_singleton_method("repeat", function!(crate::functions::lazy::repeat, 2))?; + class.define_singleton_method("repeat", function!(crate::functions::lazy::repeat, 3))?; class.define_singleton_method( "pearson_corr", function!(crate::functions::lazy::pearson_corr, 3), @@ -594,8 +593,8 @@ fn init() -> RbResult<()> { "optimization_toggle", method!(RbLazyFrame::optimization_toggle, 7), )?; - class.define_method("sort", method!(RbLazyFrame::sort, 3))?; - class.define_method("sort_by_exprs", method!(RbLazyFrame::sort_by_exprs, 3))?; + class.define_method("sort", method!(RbLazyFrame::sort, 4))?; + class.define_method("sort_by_exprs", method!(RbLazyFrame::sort_by_exprs, 4))?; class.define_method("cache", method!(RbLazyFrame::cache, 0))?; class.define_method("collect", method!(RbLazyFrame::collect, 0))?; class.define_method("sink_parquet", method!(RbLazyFrame::sink_parquet, 7))?; @@ -731,7 +730,7 @@ fn init() -> RbResult<()> { class.define_method("_clone", method!(RbSeries::clone, 0))?; class.define_method("apply_lambda", method!(RbSeries::apply_lambda, 3))?; class.define_method("zip_with", method!(RbSeries::zip_with, 2))?; - class.define_method("to_dummies", method!(RbSeries::to_dummies, 1))?; + class.define_method("to_dummies", method!(RbSeries::to_dummies, 2))?; class.define_method("peak_max", method!(RbSeries::peak_max, 0))?; class.define_method("peak_min", method!(RbSeries::peak_min, 0))?; class.define_method("n_unique", method!(RbSeries::n_unique, 0))?; diff --git a/ext/polars/src/series.rs b/ext/polars/src/series.rs index fd5fd14a09..0008f5cfe7 100644 --- a/ext/polars/src/series.rs +++ b/ext/polars/src/series.rs @@ -634,11 +634,11 @@ impl RbSeries { Ok(RbSeries::new(s)) } - pub fn to_dummies(&self, sep: Option) -> RbResult { + pub fn to_dummies(&self, sep: Option, drop_first: bool) -> RbResult { let df = self .series .borrow() - .to_dummies(sep.as_deref()) + .to_dummies(sep.as_deref(), drop_first) .map_err(RbPolarsErr::from)?; Ok(df.into()) } diff --git a/lib/polars/data_frame.rb b/lib/polars/data_frame.rb index 2918ff6fb1..3714ea05ea 100644 --- a/lib/polars/data_frame.rb +++ b/lib/polars/data_frame.rb @@ -1498,13 +1498,9 @@ def replace_at_idx(index, series) # # │ 1 ┆ 6.0 ┆ a │ # # └─────┴─────┴─────┘ def sort(by, reverse: false, nulls_last: false) - if by.is_a?(::Array) || by.is_a?(Expr) - lazy - .sort(by, reverse: reverse, nulls_last: nulls_last) - .collect(no_optimization: true, string_cache: false) - else - _from_rbdf(_df.sort(by, reverse, nulls_last)) - end + lazy + .sort(by, reverse: reverse, nulls_last: nulls_last) + .collect(no_optimization: true) end # Sort the DataFrame by column in-place. @@ -3440,7 +3436,7 @@ def unstack(step:, how: "vertical", columns: nil, fill_values: nil) # # ╞═════╪═════╪═════╡ # # │ C ┆ 2 ┆ l │ # # └─────┴─────┴─────┘} - def partition_by(groups, maintain_order: true, as_dict: false) + def partition_by(groups, maintain_order: true, include_key: true, as_dict: false) if groups.is_a?(String) groups = [groups] elsif !groups.is_a?(::Array) @@ -3450,19 +3446,19 @@ def partition_by(groups, maintain_order: true, as_dict: false) if as_dict out = {} if groups.length == 1 - _df.partition_by(groups, maintain_order).each do |df| + _df.partition_by(groups, maintain_order, include_key).each do |df| df = _from_rbdf(df) out[df[groups][0, 0]] = df end else - _df.partition_by(groups, maintain_order).each do |df| + _df.partition_by(groups, maintain_order, include_key).each do |df| df = _from_rbdf(df) out[df[groups].row(0)] = df end end out else - _df.partition_by(groups, maintain_order).map { |df| _from_rbdf(df) } + _df.partition_by(groups, maintain_order, include_key).map { |df| _from_rbdf(df) } end end @@ -4111,11 +4107,11 @@ def quantile(quantile, interpolation: "nearest") # # │ 1 ┆ 0 ┆ 1 ┆ 0 ┆ 1 ┆ 0 │ # # │ 0 ┆ 1 ┆ 0 ┆ 1 ┆ 0 ┆ 1 │ # # └───────┴───────┴───────┴───────┴───────┴───────┘ - def to_dummies(columns: nil, separator: "_") + def to_dummies(columns: nil, separator: "_", drop_first: false) if columns.is_a?(String) columns = [columns] end - _from_rbdf(_df.to_dummies(columns, separator)) + _from_rbdf(_df.to_dummies(columns, separator, drop_first)) end # Drop duplicate rows from this DataFrame. diff --git a/lib/polars/expr.rb b/lib/polars/expr.rb index 9154f3c529..917627fb21 100644 --- a/lib/polars/expr.rb +++ b/lib/polars/expr.rb @@ -2436,14 +2436,14 @@ def quantile(quantile, interpolation: "nearest") # ).sort("group_col") # # => # # shape: (2, 3) - # # ┌───────────┬──────┬─────┐ - # # │ group_col ┆ lt ┆ gte │ - # # │ --- ┆ --- ┆ --- │ - # # │ str ┆ i64 ┆ i64 │ - # # ╞═══════════╪══════╪═════╡ - # # │ g1 ┆ 1 ┆ 2 │ - # # │ g2 ┆ null ┆ 3 │ - # # └───────────┴──────┴─────┘ + # # ┌───────────┬─────┬─────┐ + # # │ group_col ┆ lt ┆ gte │ + # # │ --- ┆ --- ┆ --- │ + # # │ str ┆ i64 ┆ i64 │ + # # ╞═══════════╪═════╪═════╡ + # # │ g1 ┆ 1 ┆ 2 │ + # # │ g2 ┆ 0 ┆ 3 │ + # # └───────────┴─────┴─────┘ def filter(predicate) wrap_expr(_rbexpr.filter(predicate._rbexpr)) end @@ -2474,14 +2474,14 @@ def filter(predicate) # ).sort("group_col") # # => # # shape: (2, 3) - # # ┌───────────┬──────┬─────┐ - # # │ group_col ┆ lt ┆ gte │ - # # │ --- ┆ --- ┆ --- │ - # # │ str ┆ i64 ┆ i64 │ - # # ╞═══════════╪══════╪═════╡ - # # │ g1 ┆ 1 ┆ 2 │ - # # │ g2 ┆ null ┆ 3 │ - # # └───────────┴──────┴─────┘ + # # ┌───────────┬─────┬─────┐ + # # │ group_col ┆ lt ┆ gte │ + # # │ --- ┆ --- ┆ --- │ + # # │ str ┆ i64 ┆ i64 │ + # # ╞═══════════╪═════╪═════╡ + # # │ g1 ┆ 1 ┆ 2 │ + # # │ g2 ┆ 0 ┆ 3 │ + # # └───────────┴─────┴─────┘ def where(predicate) filter(predicate) end @@ -3500,14 +3500,15 @@ def rolling_std( min_periods: nil, center: false, by: nil, - closed: "left" + closed: "left", + ddof: 1 ) window_size, min_periods = _prepare_rolling_window_args( window_size, min_periods ) wrap_expr( _rbexpr.rolling_std( - window_size, weights, min_periods, center, by, closed + window_size, weights, min_periods, center, by, closed, ddof ) ) end @@ -3589,14 +3590,15 @@ def rolling_var( min_periods: nil, center: false, by: nil, - closed: "left" + closed: "left", + ddof: 1 ) window_size, min_periods = _prepare_rolling_window_args( window_size, min_periods ) wrap_expr( _rbexpr.rolling_var( - window_size, weights, min_periods, center, by, closed + window_size, weights, min_periods, center, by, closed, ddof ) ) end @@ -4556,11 +4558,11 @@ def reshape(dims) # # │ 1 │ # # │ 3 │ # # └─────┘ - def shuffle(seed: nil) + def shuffle(seed: nil, fixed_seed: false) if seed.nil? seed = rand(10000) end - wrap_expr(_rbexpr.shuffle(seed)) + wrap_expr(_rbexpr.shuffle(seed, fixed_seed)) end # Sample from this expression. @@ -4598,21 +4600,22 @@ def sample( with_replacement: true, shuffle: false, seed: nil, - n: nil + n: nil, + fixed_seed: false ) if !n.nil? && !frac.nil? raise ArgumentError, "cannot specify both `n` and `frac`" end if !n.nil? && frac.nil? - return wrap_expr(_rbexpr.sample_n(n, with_replacement, shuffle, seed)) + return wrap_expr(_rbexpr.sample_n(n, with_replacement, shuffle, seed, fixed_seed)) end if frac.nil? frac = 1.0 end wrap_expr( - _rbexpr.sample_frac(frac, with_replacement, shuffle, seed) + _rbexpr.sample_frac(frac, with_replacement, shuffle, seed, fixed_seed) ) end diff --git a/lib/polars/lazy_frame.rb b/lib/polars/lazy_frame.rb index 015cbe3d6d..19abd27aa2 100644 --- a/lib/polars/lazy_frame.rb +++ b/lib/polars/lazy_frame.rb @@ -395,16 +395,16 @@ def describe_optimized_plan( # # │ 2 ┆ 7.0 ┆ b │ # # │ 1 ┆ 6.0 ┆ a │ # # └─────┴─────┴─────┘ - def sort(by, reverse: false, nulls_last: false) + def sort(by, reverse: false, nulls_last: false, maintain_order: false) if by.is_a?(String) - _from_rbldf(_ldf.sort(by, reverse, nulls_last)) + return _from_rbldf(_ldf.sort(by, reverse, nulls_last, maintain_order)) end if Utils.bool?(reverse) reverse = [reverse] end by = Utils.selection_to_rbexpr_list(by) - _from_rbldf(_ldf.sort_by_exprs(by, reverse, nulls_last)) + _from_rbldf(_ldf.sort_by_exprs(by, reverse, nulls_last, maintain_order)) end # def profile diff --git a/lib/polars/lazy_functions.rb b/lib/polars/lazy_functions.rb index 49e5e84370..e3ff5d1848 100644 --- a/lib/polars/lazy_functions.rb +++ b/lib/polars/lazy_functions.rb @@ -158,7 +158,6 @@ def sum(column) col(column.to_s).sum elsif column.is_a?(::Array) exprs = Utils.selection_to_rbexpr_list(column) - # TODO Utils.wrap_expr(_sum_exprs(exprs)) else fold(lit(0).cast(:u32), ->(a, b) { a + b }, column).alias("sum") @@ -1031,19 +1030,24 @@ def struct(exprs, eager: false) # Only used in `eager` mode. As expression, use `alias`. # # @return [Expr] - def repeat(value, n, eager: false, name: nil) + def repeat(value, n, dtype: nil, eager: false, name: nil) + if !name.nil? + warn "the `name` argument is deprecated. Use the `alias` method instead." + end + + if n.is_a?(Integer) + n = lit(n) + end + + value = Utils.parse_as_expression(value, str_as_lit: true) + expr = Utils.wrap_expr(RbExpr.repeat(value, n._rbexpr, dtype)) + if !name.nil? + expr = expr.alias(name) + end if eager - if name.nil? - name = "" - end - dtype = py_type_to_dtype(type(value)) - Series._repeat(name, value, n, dtype) - else - if n.is_a?(Integer) - n = lit(n) - end - Utils.wrap_expr(RbExpr.repeat(value, n._rbexpr)) + return select(expr).to_series end + expr end # Return indices where `condition` evaluates `true`. diff --git a/lib/polars/list_expr.rb b/lib/polars/list_expr.rb index f34a0c11cc..f874049955 100644 --- a/lib/polars/list_expr.rb +++ b/lib/polars/list_expr.rb @@ -254,7 +254,7 @@ def concat(other) # # │ 1 │ # # └──────┘ def get(index) - index = Utils.expr_to_lit_or_expr(index, str_to_lit: false)._rbexpr + index = Utils.parse_as_expression(index) Utils.wrap_expr(_rbexpr.list_get(index)) end diff --git a/lib/polars/series.rb b/lib/polars/series.rb index 0da7591774..8bc3f8e4ae 100644 --- a/lib/polars/series.rb +++ b/lib/polars/series.rb @@ -719,8 +719,8 @@ def quantile(quantile, interpolation: "nearest") # # │ 0 ┆ 1 ┆ 0 │ # # │ 0 ┆ 0 ┆ 1 │ # # └─────┴─────┴─────┘ - def to_dummies(separator: "_") - Utils.wrap_df(_s.to_dummies(separator)) + def to_dummies(separator: "_", drop_first: false) + Utils.wrap_df(_s.to_dummies(separator, drop_first)) end # Count the unique values in a Series. @@ -2817,7 +2817,8 @@ def rolling_std( window_size, weights: nil, min_periods: nil, - center: false + center: false, + ddof: 1 ) to_frame .select( @@ -2825,7 +2826,8 @@ def rolling_std( window_size, weights: weights, min_periods: min_periods, - center: center + center: center, + ddof: ddof ) ) .to_series @@ -2868,7 +2870,8 @@ def rolling_var( window_size, weights: nil, min_periods: nil, - center: false + center: false, + ddof: 1 ) to_frame .select( @@ -2876,7 +2879,8 @@ def rolling_var( window_size, weights: weights, min_periods: min_periods, - center: center + center: center, + ddof: ddof ) ) .to_series diff --git a/lib/polars/string_expr.rb b/lib/polars/string_expr.rb index 5b3397bdad..b8afe33888 100644 --- a/lib/polars/string_expr.rb +++ b/lib/polars/string_expr.rb @@ -667,11 +667,11 @@ def starts_with(sub) # # │ {null,null} │ # # │ {2,false} │ # # └─────────────┘ - def json_extract(dtype = nil) + def json_extract(dtype = nil, infer_schema_length: 100) if !dtype.nil? dtype = Utils.rb_type_to_dtype(dtype) end - Utils.wrap_expr(_rbexpr.str_json_extract(dtype)) + Utils.wrap_expr(_rbexpr.str_json_extract(dtype, infer_schema_length)) end # Extract the first match of json string with provided JSONPath expression. diff --git a/lib/polars/utils.rb b/lib/polars/utils.rb index 3569db804e..a4cc5ef459 100644 --- a/lib/polars/utils.rb +++ b/lib/polars/utils.rb @@ -285,5 +285,28 @@ def self.is_str_sequence(val, allow_str: false) def self.local_file?(file) Dir.glob(file).any? end + + def self.parse_as_expression(input, str_as_lit: false, structify: false) + if input.is_a?(Expr) + expr = input + elsif input.is_a?(String) && !str_as_lit + expr = Polars.col(input) + structify = false + elsif [Integer, Float, String, Series, ::Date, ::Time, ::DateTime].any? { |cls| input.is_a?(cls) } || input.nil? + expr = Polars.lit(input) + structify = false + elsif input.is_a?(Array) + expr = Polars.lit(Polars::Series.new("", [input])) + structify = false + else + raise TypeError, "did not expect value #{input} of type #{input.class.name}, maybe disambiguate with pl.lit or pl.col" + end + + if structify + raise Todo + end + + expr._rbexpr + end end end