diff --git a/Cargo.lock b/Cargo.lock index e408ebe..3c85a01 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -30,6 +30,21 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "argminmax" version = "0.6.2" @@ -45,6 +60,15 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf7d0a018de4f6aa429b9d33d69edf69072b1c5b1cb8d3e4a5f7ef898fc3eb76" +[[package]] +name = "atoi" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" +dependencies = [ + "num-traits", +] + [[package]] name = "atoi_simd" version = "0.15.6" @@ -71,9 +95,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bumpalo" @@ -83,9 +107,9 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.16.1" +version = "1.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" +checksum = "102087e286b4677862ea56cf8fc58bb2cdfa8725c40ffb80fe3a008eb7f2fc83" dependencies = [ "bytemuck_derive", ] @@ -98,7 +122,7 @@ checksum = "1ee891b04274a59bd38b412188e24b849617b2e45a0fd8d057deb63e7403761b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.74", ] [[package]] @@ -109,15 +133,20 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "cc" -version = "1.0.100" +version = "1.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c891175c3fb232128f48de6590095e59198bbeb8620c310be349bfc3afd12c7b" +checksum = "5fb8dd288a69fc53a1996d7ecfbf4a20d59065bff137ce7e56bbd620de191189" +dependencies = [ + "jobserver", + "libc", + "shlex", +] [[package]] name = "cfg-if" @@ -131,7 +160,47 @@ version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ + "android-tzdata", + "iana-time-zone", "num-traits", + "windows-targets 0.52.6", +] + +[[package]] +name = "chrono-tz" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59ae0466b83e838b81a54256c39d5d7c20b9d7daa10510a242d9b75abd5936e" +dependencies = [ + "chrono", + "chrono-tz-build", + "phf", +] + +[[package]] +name = "chrono-tz-build" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "433e39f13c9a060046954e0592a8d0a4bcb1040125cbf91cb8ee58964cfb350f" +dependencies = [ + "parse-zoneinfo", + "phf", + "phf_codegen", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "crossbeam-channel" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +dependencies = [ + "crossbeam-utils", ] [[package]] @@ -153,6 +222,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.20" @@ -206,9 +284,9 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "either" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "elapsed" @@ -216,6 +294,18 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f4e5af126dafd0741c2ad62d47f68b28602550102e5f0dd45c8a97fc8b49c29" +[[package]] +name = "enum_dispatch" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa18ce2bc66555b3218614519ac839ddb759a7d6720732f979ef8d13be147ecd" +dependencies = [ + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.74", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -242,9 +332,9 @@ checksum = "95765f67b4b18863968b4a1bd5bb576f732b29a4a28c7cd84c09fa3e2875f33c" [[package]] name = "fixed" -version = "1.27.0" +version = "1.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fc715d38bea7b5bf487fcd79bcf8c209f0b58014f3018a7a19c2b855f472048" +checksum = "85c6e0b89bf864acd20590dbdbad56f69aeb898abfc9443008fd7bd48b2cc85a" dependencies = [ "az", "bytemuck", @@ -254,10 +344,13 @@ dependencies = [ ] [[package]] -name = "foreign_vec" -version = "0.1.0" +name = "float-cmp" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee1b05cbd864bcaecbd3455d6d967862d446e4ebfc3c2e5e5b9841e53cba6673" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" +dependencies = [ + "num-traits", +] [[package]] name = "generator" @@ -269,7 +362,7 @@ dependencies = [ "libc", "log", "rustversion", - "windows", + "windows 0.48.0", ] [[package]] @@ -301,6 +394,16 @@ dependencies = [ "crunchy", ] +[[package]] +name = "halfbrown" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8588661a8607108a5ca69cab034063441a0413a0b041c13618a7dd348021ef6f" +dependencies = [ + "hashbrown", + "serde", +] + [[package]] name = "hashbrown" version = "0.14.5" @@ -315,15 +418,15 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] -name = "heck" -version = "0.5.0" +name = "hex" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "home" @@ -334,11 +437,34 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core 0.52.0", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + [[package]] name = "indexmap" -version = "2.2.6" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" dependencies = [ "equivalent", "hashbrown", @@ -377,6 +503,12 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "itoap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9028f49264629065d057f340a86acb84867925865f73bbf8d47b4d149a7e88b8" + [[package]] name = "jemalloc-sys" version = "0.5.4+5.3.0-patched" @@ -397,11 +529,20 @@ dependencies = [ "libc", ] +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -435,6 +576,70 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +[[package]] +name = "lexical-core" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cde5de06e8d4c2faabc400238f9ae1c74d5412d03a7bd067645ccbc47070e46" +dependencies = [ + "lexical-parse-float", + "lexical-parse-integer", + "lexical-util", + "lexical-write-float", + "lexical-write-integer", +] + +[[package]] +name = "lexical-parse-float" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683b3a5ebd0130b8fb52ba0bdc718cc56815b6a097e28ae5a6997d0ad17dc05f" +dependencies = [ + "lexical-parse-integer", + "lexical-util", + "static_assertions", +] + +[[package]] +name = "lexical-parse-integer" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d0994485ed0c312f6d965766754ea177d07f9c00c9b82a5ee62ed5b47945ee9" +dependencies = [ + "lexical-util", + "static_assertions", +] + +[[package]] +name = "lexical-util" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5255b9ff16ff898710eb9eb63cb39248ea8a5bb036bea8085b1a767ff6c4e3fc" +dependencies = [ + "static_assertions", +] + +[[package]] +name = "lexical-write-float" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accabaa1c4581f05a3923d1b4cfd124c329352288b7b9da09e766b0668116862" +dependencies = [ + "lexical-util", + "lexical-write-integer", + "static_assertions", +] + +[[package]] +name = "lexical-write-integer" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1b6f3d1f4422866b68192d62f77bc5c700bee84f3069f2469d7bc8c77852446" +dependencies = [ + "lexical-util", + "static_assertions", +] + [[package]] name = "libc" version = "0.2.155" @@ -459,9 +664,29 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "lz4" +version = "1.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958b4caa893816eea05507c20cfe47574a43d9a697138a7872990bba8a0ece68" +dependencies = [ + "libc", + "lz4-sys", +] + +[[package]] +name = "lz4-sys" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "109de74d5d2353660401699a4174a4ff23fcc649caf553df71933c7fb45ad868" +dependencies = [ + "cc", + "libc", +] [[package]] name = "memchr" @@ -495,6 +720,7 @@ dependencies = [ "polars", "polars-arrow", "polars-core", + "polars-sql", "pyo3", "pyo3-polars", "reverse_geocoder", @@ -523,6 +749,24 @@ dependencies = [ "target-features", ] +[[package]] +name = "now" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d89e9874397a1f0a52fc1f197a8effd9735223cb2390e9dcc83ac6cd02923d0" +dependencies = [ + "chrono", +] + +[[package]] +name = "ntapi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" +dependencies = [ + "winapi", +] + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -535,9 +779,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", @@ -570,9 +814,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "ordered-float" -version = "4.2.0" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76df7075c7d4d01fdcb46c912dd17fba5b60c78ea480b475f2b6ab6f666584e" +checksum = "4a91171844676f8c7990ce64959210cd2eaef32c2612c50f9fae9f8aaa6065a6" dependencies = [ "num-traits", ] @@ -603,7 +847,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -612,18 +856,71 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1131c54b167dd4e4799ce762e1ab01549ebb94d5bdd13e6ec1b467491c378e1f" +[[package]] +name = "parse-zoneinfo" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f2a05b18d44e2957b88f96ba460715e295bc1d7510468a2f3d3b44535d26c24" +dependencies = [ + "regex", +] + [[package]] name = "percent-encoding" version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_codegen" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" +dependencies = [ + "phf_generator", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project-lite" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + [[package]] name = "planus" version = "0.3.1" @@ -635,9 +932,9 @@ dependencies = [ [[package]] name = "polars" -version = "0.41.3" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e3351ea4570e54cd556e6755b78fe7a2c85368d820c0307cca73c96e796a7ba" +checksum = "ad002eb9c541b4f7e0c7c759cefe884a0350e15d241231ac4be31c5568c15070" dependencies = [ "getrandom", "polars-arrow", @@ -647,30 +944,35 @@ dependencies = [ "polars-lazy", "polars-ops", "polars-parquet", + "polars-sql", "polars-utils", "version_check", ] [[package]] name = "polars-arrow" -version = "0.41.3" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba65fc4bcabbd64fca01fd30e759f8b2043f0963c57619e331d4b534576c0b47" +checksum = "32d19c6db79cb6a3c55af3b5a3976276edaab64cbf7f69b392617c2af30d7742" dependencies = [ "ahash", + "atoi", "atoi_simd", "bytemuck", "chrono", + "chrono-tz", "dyn-clone", "either", "ethnum", "fast-float", - "foreign_vec", "getrandom", "hashbrown", "itoa", + "itoap", + "lz4", "multiversion", "num-traits", + "parking_lot", "polars-arrow-format", "polars-error", "polars-utils", @@ -679,6 +981,7 @@ dependencies = [ "streaming-iterator", "strength_reduce", "version_check", + "zstd", ] [[package]] @@ -693,9 +996,9 @@ dependencies = [ [[package]] name = "polars-compute" -version = "0.41.3" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f099516af30ac9ae4b4480f4ad02aa017d624f2f37b7a16ad4e9ba52f7e5269" +checksum = "30194a5ff325f61d6fcb62dc215c9210f308fc4fc85a493ef777dbcd938cba24" dependencies = [ "bytemuck", "either", @@ -709,14 +1012,15 @@ dependencies = [ [[package]] name = "polars-core" -version = "0.41.3" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2439484be228b8c302328e2f953e64cfd93930636e5c7ceed90339ece7fef6c" +checksum = "2ba2a3b736d55b92a12889672d0197dc25ad321ab23eba4168a3b6316a6b6349" dependencies = [ "ahash", "bitflags", "bytemuck", "chrono", + "chrono-tz", "either", "hashbrown", "indexmap", @@ -739,9 +1043,9 @@ dependencies = [ [[package]] name = "polars-error" -version = "0.41.3" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9b06dfbe79cabe50a7f0a90396864b5ee2c0e0f8d6a9353b2343c29c56e937" +checksum = "07101d1803ca2046cdb3a8adb1523ddcc879229860f0ac56a853034269dec1e1" dependencies = [ "polars-arrow-format", "regex", @@ -751,9 +1055,9 @@ dependencies = [ [[package]] name = "polars-expr" -version = "0.41.3" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c630385a56a867c410a20f30772d088f90ec3d004864562b84250b35268f97" +checksum = "dd5c69634ddbb0f44186cd1c42d166963fc756f9cc994438e941bc2703ddbbab" dependencies = [ "ahash", "bitflags", @@ -763,6 +1067,7 @@ dependencies = [ "polars-io", "polars-ops", "polars-plan", + "polars-time", "polars-utils", "rayon", "smartstring", @@ -770,9 +1075,9 @@ dependencies = [ [[package]] name = "polars-ffi" -version = "0.41.2" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ae8d5a4479d7c375891d2730446fefc2631d4405b3a22b7993fdc8cf9494b1f" +checksum = "121eb464d69f70284fa675f791e8a8fa5539efebb588ba9193ac90998c9c647c" dependencies = [ "polars-arrow", "polars-core", @@ -780,14 +1085,15 @@ dependencies = [ [[package]] name = "polars-io" -version = "0.41.3" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d7363cd14e4696a28b334a56bd11013ff49cc96064818ab3f91a126e453462d" +checksum = "a48ddf416ae185336c3d7880d2e05b7e55686e3e0da1014e5e7325eff9c7d722" dependencies = [ "ahash", "atoi_simd", "bytes", "fast-float", + "glob", "home", "itoa", "memchr", @@ -798,6 +1104,7 @@ dependencies = [ "polars-arrow", "polars-core", "polars-error", + "polars-json", "polars-utils", "rayon", "regex", @@ -806,15 +1113,35 @@ dependencies = [ "smartstring", ] +[[package]] +name = "polars-json" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0a43388585a922524e8bbaa1ed1391c9c4b0768a644585609afa9a2fd5fc702" +dependencies = [ + "ahash", + "chrono", + "fallible-streaming-iterator", + "hashbrown", + "indexmap", + "itoa", + "num-traits", + "polars-arrow", + "polars-error", + "polars-utils", + "ryu", + "simd-json", + "streaming-iterator", +] + [[package]] name = "polars-lazy" -version = "0.41.3" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03877e74e42b5340ae52ded705f6d5d14563d90554c9177b01b91ed2412a56ed" +checksum = "a514a85df9e7d501c71c96f094861d0608b05a3f533447b1c0ea9cf714162fcb" dependencies = [ "ahash", "bitflags", - "glob", "memchr", "once_cell", "polars-arrow", @@ -823,7 +1150,9 @@ dependencies = [ "polars-io", "polars-mem-engine", "polars-ops", + "polars-pipe", "polars-plan", + "polars-time", "polars-utils", "rayon", "smartstring", @@ -832,10 +1161,11 @@ dependencies = [ [[package]] name = "polars-mem-engine" -version = "0.41.3" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea9e17771af750c94bf959885e4b3f5b14149576c62ef3ec1c9ef5827b2a30f" +checksum = "2d057df81b17b4f0ea0e4424ee34f755e6b9ccfba432ecb2fe57dc4da6da2713" dependencies = [ + "memmap2", "polars-arrow", "polars-core", "polars-error", @@ -843,21 +1173,26 @@ dependencies = [ "polars-io", "polars-ops", "polars-plan", + "polars-time", "polars-utils", "rayon", ] [[package]] name = "polars-ops" -version = "0.41.3" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6066552eb577d43b307027fb38096910b643ffb2c89a21628c7e41caf57848d0" +checksum = "01ba44233249b7937491b5d2bdbf14e4ad534c0a65d06548c3bc418fc3e60791" dependencies = [ "ahash", "argminmax", + "base64", "bytemuck", + "chrono", + "chrono-tz", "either", "hashbrown", + "hex", "indexmap", "memchr", "num-traits", @@ -869,17 +1204,19 @@ dependencies = [ "rayon", "regex", "smartstring", + "unicode-reverse", "version_check", ] [[package]] name = "polars-parquet" -version = "0.41.3" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b35b2592a2e7ef7ce9942dc2120dc4576142626c0e661668e4c6b805042e461" +checksum = "bb2993265079ffa07dd16277189444424f8d787b00b01c6f6e001f58bab543ce" dependencies = [ "ahash", "base64", + "bytemuck", "ethnum", "num-traits", "parquet-format-safe", @@ -891,25 +1228,57 @@ dependencies = [ "streaming-decompression", ] +[[package]] +name = "polars-pipe" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ccba94c4fa9fded0f41730f7649574c72d6d938a840731c7e4eea4e7ed5cecf" +dependencies = [ + "crossbeam-channel", + "crossbeam-queue", + "enum_dispatch", + "hashbrown", + "num-traits", + "polars-arrow", + "polars-compute", + "polars-core", + "polars-expr", + "polars-io", + "polars-ops", + "polars-plan", + "polars-row", + "polars-utils", + "rayon", + "smartstring", + "uuid", + "version_check", +] + [[package]] name = "polars-plan" -version = "0.41.3" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "220d0d7c02d1c4375802b2813dbedcd1a184df39c43b74689e729ede8d5c2921" +checksum = "5d6b29cc53d6c086c09b11050b01c25c28f6a91339036ba1fb1250fcf0d89e74" dependencies = [ "ahash", + "bitflags", "bytemuck", + "chrono", + "chrono-tz", "either", "hashbrown", + "memmap2", "once_cell", "percent-encoding", "polars-arrow", "polars-core", "polars-io", "polars-ops", + "polars-time", "polars-utils", "rayon", "recursive", + "regex", "smartstring", "strum_macros", "version_check", @@ -917,9 +1286,9 @@ dependencies = [ [[package]] name = "polars-row" -version = "0.41.3" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1d70d87a2882a64a43b431aea1329cb9a2c4100547c95c417cc426bb82408b3" +checksum = "6e11f43f48466c4b1caa6dc61c381dc10c2d67b87fcb74bc996e21c4f7b0a311" dependencies = [ "bytemuck", "polars-arrow", @@ -927,16 +1296,60 @@ dependencies = [ "polars-utils", ] +[[package]] +name = "polars-sql" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e9338806e7254618eb819cc632c34b75b71d462222a913f9c1035ed81911ddc" +dependencies = [ + "hex", + "once_cell", + "polars-arrow", + "polars-core", + "polars-error", + "polars-lazy", + "polars-ops", + "polars-plan", + "polars-time", + "rand", + "serde", + "serde_json", + "sqlparser", +] + +[[package]] +name = "polars-time" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30a601ab9a62e733b8b560b37642321cb1933faa194864739f6a59d6dfc4d686" +dependencies = [ + "atoi", + "bytemuck", + "chrono", + "chrono-tz", + "now", + "once_cell", + "polars-arrow", + "polars-core", + "polars-error", + "polars-ops", + "polars-utils", + "regex", + "smartstring", +] + [[package]] name = "polars-utils" -version = "0.41.3" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e6dd89fcccb1ec1a62f752c9a9f2d482a85e9255153f46efecc617b4996d50" +checksum = "19dd73207bd15efb0ae5c9c3ece3227927ed6a16ad63578acec342378e6bdcb4" dependencies = [ "ahash", "bytemuck", + "bytes", "hashbrown", "indexmap", + "memmap2", "num-traits", "once_cell", "polars-error", @@ -944,20 +1357,24 @@ dependencies = [ "rayon", "smartstring", "stacker", + "sysinfo", "version_check", ] [[package]] name = "portable-atomic" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" +checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "proc-macro2" @@ -979,15 +1396,15 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.21.2" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e00b96a521718e08e03b1a622f01c8a8deb50719335de3f60b3b3950f069d8" +checksum = "831e8e819a138c36e212f3af3fd9eeffed6bf1510a805af35b0edee5ffa59433" dependencies = [ "cfg-if", "indoc", "libc", "memoffset", - "parking_lot", + "once_cell", "portable-atomic", "pyo3-build-config", "pyo3-ffi", @@ -997,9 +1414,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.21.2" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7883df5835fafdad87c0d888b266c8ec0f4c9ca48a5bed6bbb592e8dedee1b50" +checksum = "1e8730e591b14492a8945cdff32f089250b05f5accecf74aeddf9e8272ce1fa8" dependencies = [ "once_cell", "target-lexicon", @@ -1007,9 +1424,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.21.2" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01be5843dc60b916ab4dad1dca6d20b9b4e6ddc8e15f50c47fe6d85f1fb97403" +checksum = "5e97e919d2df92eb88ca80a037969f44e5e70356559654962cbb3316d00300c6" dependencies = [ "libc", "pyo3-build-config", @@ -1017,35 +1434,36 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.21.2" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77b34069fc0682e11b31dbd10321cbf94808394c56fd996796ce45217dfac53c" +checksum = "eb57983022ad41f9e683a599f2fd13c3664d7063a3ac5714cae4b7bee7d3f206" dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 2.0.68", + "syn 2.0.74", ] [[package]] name = "pyo3-macros-backend" -version = "0.21.2" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08260721f32db5e1a5beae69a55553f56b99bd0e1c3e6e0a5e8851a9d0f5a85c" +checksum = "ec480c0c51ddec81019531705acac51bcdbeae563557c982aa8263bb96880372" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "pyo3-build-config", "quote", - "syn 2.0.68", + "syn 2.0.74", ] [[package]] name = "pyo3-polars" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "910d4952410bded2d87e13d48ca8e59b7fe028b07d29deaffd4539b3d906e75f" +version = "0.16.0" +source = "git+https://github.com/MarcoGorelli/pyo3-polars.git?rev=a0327ec121986711aec32dc1e52234838bf3b25b#a0327ec121986711aec32dc1e52234838bf3b25b" dependencies = [ + "libc", + "once_cell", "polars", "polars-core", "polars-ffi", @@ -1059,16 +1477,15 @@ dependencies = [ [[package]] name = "pyo3-polars-derive" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b6ee1fa8425af0d3ec588cba614fc2f3fd8e4838fb74f38987e697196884fe" +version = "0.10.0" +source = "git+https://github.com/MarcoGorelli/pyo3-polars.git?rev=a0327ec121986711aec32dc1e52234838bf3b25b#a0327ec121986711aec32dc1e52234838bf3b25b" dependencies = [ "polars-core", "polars-ffi", "polars-plan", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.74", ] [[package]] @@ -1122,9 +1539,9 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.0.2" +version = "11.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e29830cbb1290e404f24c73af91c5d8d631ce7e128691e9477556b540cd01ecd" +checksum = "cb9ee317cfe3fbd54b36a511efc1edd42e216903c9cd575e686dd68a2ba90d8d" dependencies = [ "bitflags", ] @@ -1166,23 +1583,43 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76009fbe0614077fc1a2ce255e3a1881a2e3a3527097d5dc6d8212c585e7e38b" dependencies = [ "quote", - "syn 2.0.68", + "syn 2.0.74", ] [[package]] name = "redox_syscall" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ "bitflags", ] +[[package]] +name = "ref-cast" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.74", +] + [[package]] name = "regex" -version = "1.10.5" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", @@ -1239,9 +1676,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.203" +version = "1.0.207" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "5665e14a49a4ea1b91029ba7d3bca9f299e1f7cfa194388ccc20f14743e784f2" dependencies = [ "serde_derive", ] @@ -1261,13 +1698,25 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.207" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "6aea2634c86b0e8ef2cfdc0c340baede54ec27b1e46febd7f80dffb2aa44a00e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.74", +] + +[[package]] +name = "serde_json" +version = "1.0.124" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66ad62847a56b3dba58cc891acd13884b9c61138d330c0d7b6181713d4fce38d" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", ] [[package]] @@ -1279,12 +1728,42 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "simd-json" +version = "0.13.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "570c430b3d902ea083097e853263ae782dfe40857d93db019a12356c8e8143fa" +dependencies = [ + "ahash", + "getrandom", + "halfbrown", + "lexical-core", + "once_cell", + "ref-cast", + "serde", + "serde_json", + "simdutf8", + "value-trait", +] + [[package]] name = "simdutf8" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + [[package]] name = "smallvec" version = "1.13.2" @@ -1308,6 +1787,15 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6734caf0b6f51addd5eeacca12fb39b2c6c14e8d4f3ac42f3a78955c0467458" +[[package]] +name = "sqlparser" +version = "0.49.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a404d0e14905361b918cb8afdb73605e25c1d5029312bd9785142dcb3aa49e" +dependencies = [ + "log", +] + [[package]] name = "stacker" version = "0.1.15" @@ -1354,11 +1842,11 @@ version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "rustversion", - "syn 2.0.68", + "syn 2.0.74", ] [[package]] @@ -1374,15 +1862,28 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.68" +version = "2.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" +checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "sysinfo" +version = "0.31.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4115055da5f572fff541dd0c4e61b0262977f453cc9fe04be83aba25a89bdab" +dependencies = [ + "core-foundation-sys", + "libc", + "memchr", + "ntapi", + "windows 0.57.0", +] + [[package]] name = "target-features" version = "0.1.6" @@ -1391,28 +1892,28 @@ checksum = "c1bbb9f3c5c463a01705937a24fdabc5047929ac764b2d5b9cf681c1f5041ed5" [[package]] name = "target-lexicon" -version = "0.12.14" +version = "0.12.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.74", ] [[package]] @@ -1444,7 +1945,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.74", ] [[package]] @@ -1500,23 +2001,59 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "unicode-reverse" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b6f4888ebc23094adfb574fdca9fdc891826287a6397d2cd28802ffd6f20c76" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "unicode-segmentation" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" + [[package]] name = "unindent" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce" +[[package]] +name = "uuid" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +dependencies = [ + "getrandom", +] + [[package]] name = "valuable" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +[[package]] +name = "value-trait" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dad8db98c1e677797df21ba03fca7d3bf9bec3ca38db930954e4fe6e1ea27eb4" +dependencies = [ + "float-cmp", + "halfbrown", + "itoa", + "ryu", +] + [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wasi" @@ -1526,34 +2063,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.74", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1561,22 +2099,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.74", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "winapi" @@ -1609,13 +2147,75 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" +dependencies = [ + "windows-core 0.57.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-result", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-implement" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.74", +] + +[[package]] +name = "windows-interface" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.74", +] + +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -1635,18 +2235,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -1657,9 +2257,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -1669,9 +2269,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -1681,15 +2281,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -1699,9 +2299,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -1711,9 +2311,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -1723,9 +2323,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -1735,32 +2335,61 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "xxhash-rust" -version = "0.8.10" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" +checksum = "6a5cbf750400958819fb6178eaa83bee5cd9c29a26a40cc241df8c70fdd46984" [[package]] name = "zerocopy" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.74", +] + +[[package]] +name = "zstd" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "7.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" +dependencies = [ + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.13+zstd.1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" +dependencies = [ + "cc", + "pkg-config", ] diff --git a/Cargo.toml b/Cargo.toml index b29cdd2..07c0241 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,14 +12,18 @@ name = "minimal_plugin" crate-type= ["cdylib"] [dependencies] -pyo3 = { version = "0.21.2", features = ["extension-module"] } -pyo3-polars = { version = "0.15.0", features = ["derive"] } +pyo3 = { version = "0.22.2", features = ["extension-module", "abi3-py38"] } +pyo3-polars = { version = "0.16.0", features = ["derive", "dtype-struct", "dtype-decimal"] } serde = { version = "1", features = ["derive"] } -polars = { version = "0.41.3", features=["dtype-struct"], default-features = false } -polars-arrow = { version = "0.41.3", default-features = false } -polars-core = { version = "0.41.3", default-features = false } +polars = { version = "0.42.0", features = ["dtype-struct"], default-features = false } +polars-arrow = { version = "0.42.0", default-features = false } +polars-core = { version = "0.42.0", default-features = false } +polars-sql = { version = "0.42.0", default-features = false } reverse_geocoder = "4.1.1" # rust-stemmers = "1.2.0" +[patch.crates-io] +pyo3-polars = { git = 'https://github.com/MarcoGorelli/pyo3-polars.git', rev='a0327ec121986711aec32dc1e52234838bf3b25b' } + [target.'cfg(target_os = "linux")'.dependencies] jemallocator = { version = "0.5", features = ["disable_initial_exec_tls"] } diff --git a/docs/arguments.md b/docs/arguments.md index 330036a..d55a8f5 100644 --- a/docs/arguments.md +++ b/docs/arguments.md @@ -49,7 +49,7 @@ which is going to be very similar to the good version of `pig_latinnify`: fn add_suffix(inputs: &[Series], kwargs: AddSuffixKwargs) -> PolarsResult { let s = &inputs[0]; let ca = s.str()?; - let out = ca.apply_to_buffer(|value, output| { + let out = ca.apply_into_string_amortized(|value, output| { write!(output, "{}{}", value, kwargs.suffix).unwrap(); }); Ok(out.into_series()) diff --git a/docs/lists_in_lists_out.md b/docs/lists_in_lists_out.md index 4ce56c6..69ebe0c 100644 --- a/docs/lists_in_lists_out.md +++ b/docs/lists_in_lists_out.md @@ -59,7 +59,7 @@ fn non_zero_indices(inputs: &[Series]) -> PolarsResult { Ok(out.into_series()) } ``` -`apply_amortized` is a bit like the `apply_to_buffer` function we used in [How to STRING something together], +`apply_amortized` is a bit like the `apply_into_string_amortized` function we used in [How to STRING something together], in that it makes a big allocation upfront to amortize the allocation costs. Think of it as a list version of `apply_values`, where each element is itself a `Series`. diff --git a/docs/lost_in_space.md b/docs/lost_in_space.md index 5d6e384..63a962f 100644 --- a/docs/lost_in_space.md +++ b/docs/lost_in_space.md @@ -35,7 +35,7 @@ for longitude) and producing a String output column. ## Binary elementwise apply to buffer -In [How to STRING something together], we learned how to use `StringChunked.apply_to_buffer` +In [How to STRING something together], we learned how to use `StringChunked.apply_into_string_amortized` to run an elementwise function on a String column. Does Polars have a binary version of that one which allows us to start from any data type? diff --git a/docs/stem.md b/docs/stem.md index 7ac3f77..5f3f7bc 100644 --- a/docs/stem.md +++ b/docs/stem.md @@ -53,7 +53,7 @@ use rust_stemmers::{Algorithm, Stemmer}; fn snowball_stem(inputs: &[Series]) -> PolarsResult { let ca: &StringChunked = inputs[0].str()?; let en_stemmer = Stemmer::create(Algorithm::English); - let out: StringChunked = ca.apply_to_buffer(|value: &str, output: &mut String| { + let out: StringChunked = ca.apply_into_string_amortized(|value: &str, output: &mut String| { write!(output, "{}", en_stemmer.stem(value)).unwrap() }); Ok(out.into_series()) diff --git a/docs/stringify.md b/docs/stringify.md index 03e23f3..f8dcefb 100644 --- a/docs/stringify.md +++ b/docs/stringify.md @@ -89,7 +89,7 @@ Can we do better? ## Pig-latinnify - take 2 -Yes! `StringChunked` has a utility `apply_to_buffer` method which amortises +Yes! `StringChunked` has a utility `apply_into_string_amortized` method which amortises the cost of creating new strings for each row by creating a string upfront, clearing it, and repeatedly writing to it. This gives a 4x speedup! All you need to do is change `pig_latinnify` to: @@ -98,7 +98,7 @@ This gives a 4x speedup! All you need to do is change `pig_latinnify` to: #[polars_expr(output_type=String)] fn pig_latinnify(inputs: &[Series]) -> PolarsResult { let ca: &StringChunked = inputs[0].str()?; - let out: StringChunked = ca.apply_to_buffer(|value: &str, output: &mut String| { + let out: StringChunked = ca.apply_into_string_amortized(|value: &str, output: &mut String| { if let Some(first_char) = value.chars().next() { write!(output, "{}{}ay", &value[1..], first_char).unwrap() } diff --git a/docs/struct.md b/docs/struct.md index 558860a..1336a2d 100644 --- a/docs/struct.md +++ b/docs/struct.md @@ -24,8 +24,8 @@ def shift_struct(expr: IntoExpr) -> pl.Expr: On the Rust side, we need to start by activating the necessary feature - in `Cargo.toml`, please make this change: ```diff --polars = { version = "0.41.3", default-features = false } -+polars = { version = "0.41.3", features=["dtype-struct"], default-features = false } +-polars = { version = "0.42.0", default-features = false } ++polars = { version = "0.42.0", features=["dtype-struct"], default-features = false } ``` Then, we need to get the schema right. diff --git a/minimal_plugin/__init__.py b/minimal_plugin/__init__.py index 19a2597..d70e2ea 100644 --- a/minimal_plugin/__init__.py +++ b/minimal_plugin/__init__.py @@ -1,15 +1,20 @@ +from __future__ import annotations +from typing import TYPE_CHECKING + import polars as pl from pathlib import Path -from polars.type_aliases import IntoExpr from minimal_plugin.utils import register_plugin, parse_version if parse_version(pl.__version__) < parse_version("0.20.16"): - from polars.utils.udfs import _get_shared_lib_location + from polars.utils.udfs import _get_shared_lib_location # type: ignore[missing-import] lib: str | Path = _get_shared_lib_location(__file__) else: lib = Path(__file__).parent +if TYPE_CHECKING: + from minimal_plugin.typing import IntoExpr + def noop(expr: IntoExpr) -> pl.Expr: return register_plugin( @@ -141,6 +146,7 @@ def interpolate(expr: IntoExpr) -> pl.Expr: is_elementwise=False, ) + def life_step(left: IntoExpr, mid: IntoExpr, right: IntoExpr) -> pl.Expr: return register_plugin( args=[left, mid, right], diff --git a/minimal_plugin/typing.py b/minimal_plugin/typing.py new file mode 100644 index 0000000..0683fd9 --- /dev/null +++ b/minimal_plugin/typing.py @@ -0,0 +1,14 @@ +from typing import TYPE_CHECKING, Union + +if TYPE_CHECKING: + import sys + import polars as pl + + if sys.version_info >= (3, 10): + from typing import TypeAlias + else: + from typing_extensions import TypeAlias + from polars.datatypes import DataType, DataTypeClass + + IntoExpr: TypeAlias = Union[pl.Expr, str, pl.Series] + PolarsDataType: TypeAlias = Union[DataType, DataTypeClass] diff --git a/minimal_plugin/utils.py b/minimal_plugin/utils.py index e1cea3c..0998a8a 100644 --- a/minimal_plugin/utils.py +++ b/minimal_plugin/utils.py @@ -6,7 +6,7 @@ import polars as pl if TYPE_CHECKING: - from polars.type_aliases import IntoExpr, PolarsDataType + from my_plugin.typing import IntoExpr, PolarsDataType from pathlib import Path @@ -54,18 +54,18 @@ def register_plugin( *, symbol: str, is_elementwise: bool, + kwargs: dict[str, Any] | None = None, args: list[IntoExpr], lib: str | Path, - kwargs: dict[str, Any] | None = None, returns_scalar: bool = False, ) -> pl.Expr: if parse_version(pl.__version__) < parse_version("0.20.16"): - assert isinstance(args[0], pl.Expr) + expr = parse_into_expr(args[0]) assert isinstance(lib, str) - return args[0].register_plugin( + return expr.register_plugin( lib=lib, symbol=symbol, - args=args[1:], + args=args[1:], # type: ignore[arg-type] kwargs=kwargs, is_elementwise=is_elementwise, returns_scalar=returns_scalar, diff --git a/perf.py b/perf.py index eba8a50..a0d3e3d 100644 --- a/perf.py +++ b/perf.py @@ -16,34 +16,43 @@ ) """ -results = np.array(timeit.Timer( - stmt="df.select(pl.col('a').mp.abs_i64_fast())", - setup=setup, +results = ( + np.array( + timeit.Timer( + stmt="df.select(pl.col('a').mp.abs_i64_fast())", + setup=setup, + ).repeat(7, 3) ) - .repeat(7, 3) -)/3 -print(f'min: {min(results)}') -print(f'max: {max(results)}') -print(f'{np.mean(results)} +/- {np.std(results)/np.sqrt(len(results))}') + / 3 +) +print(f"min: {min(results)}") +print(f"max: {max(results)}") +print(f"{np.mean(results)} +/- {np.std(results)/np.sqrt(len(results))}") -results = np.array(timeit.Timer( - stmt="df.select(pl.col('a').mp.abs_i64())", - setup=setup, +results = ( + np.array( + timeit.Timer( + stmt="df.select(pl.col('a').mp.abs_i64())", + setup=setup, + ).repeat(7, 3) ) - .repeat(7, 3) -)/3 -print(f'min: {min(results)}') -print(f'max: {max(results)}') -print(f'{np.mean(results)} +/- {np.std(results)/np.sqrt(len(results))}') + / 3 +) +print(f"min: {min(results)}") +print(f"max: {max(results)}") +print(f"{np.mean(results)} +/- {np.std(results)/np.sqrt(len(results))}") with warnings.catch_warnings(): warnings.simplefilter("ignore") - results = np.array(timeit.Timer( - stmt="df.select(pl.col('a').map_elements(lambda x: abs(x)))", - setup=setup, + results = ( + np.array( + timeit.Timer( + stmt="df.select(pl.col('a').map_elements(lambda x: abs(x)))", + setup=setup, + ).repeat(7, 3) ) - .repeat(7, 3) - )/3 -print(f'min: {min(results)}') -print(f'max: {max(results)}') -print(f'{np.mean(results)} +/- {np.std(results)/np.sqrt(len(results))}') + / 3 + ) +print(f"min: {min(results)}") +print(f"max: {max(results)}") +print(f"{np.mean(results)} +/- {np.std(results)/np.sqrt(len(results))}") diff --git a/perf_list.py b/perf_list.py index cac14ed..1b3780d 100644 --- a/perf_list.py +++ b/perf_list.py @@ -12,22 +12,28 @@ df = pl.DataFrame({'a': [rng.integers(low=-100, high=100, size=5) for _ in range(N)]}) """ -results = np.array(timeit.Timer( - stmt="df.select(mp.non_zero_indices('a'))", - setup=setup, +results = ( + np.array( + timeit.Timer( + stmt="df.select(mp.non_zero_indices('a'))", + setup=setup, + ).repeat(7, 3) ) - .repeat(7, 3) -)/3 -print(f'min: {min(results)}') -print(f'max: {max(results)}') -print(f'{np.mean(results)} +/- {np.std(results)/np.sqrt(len(results))}') + / 3 +) +print(f"min: {min(results)}") +print(f"max: {max(results)}") +print(f"{np.mean(results)} +/- {np.std(results)/np.sqrt(len(results))}") -results = np.array(timeit.Timer( - stmt="df.select(pl.col('a').list.eval(pl.arg_where(pl.element() != 0)))", - setup=setup, +results = ( + np.array( + timeit.Timer( + stmt="df.select(pl.col('a').list.eval(pl.arg_where(pl.element() != 0)))", + setup=setup, + ).repeat(7, 3) ) - .repeat(7, 3) -)/3 -print(f'min: {min(results)}') -print(f'max: {max(results)}') -print(f'{np.mean(results)} +/- {np.std(results)/np.sqrt(len(results))}') + / 3 +) +print(f"min: {min(results)}") +print(f"max: {max(results)}") +print(f"{np.mean(results)} +/- {np.std(results)/np.sqrt(len(results))}") diff --git a/run.py b/run.py index 2ce8ed1..70e1762 100644 --- a/run.py +++ b/run.py @@ -5,26 +5,35 @@ import polars as pl import minimal_plugin as mp -df = pl.DataFrame({ - 'values': [[1, 3, 2], [5, 7], []], - 'weights': [[.5, .3, .2], [.1, .9], []] -}) -print(df.with_columns(weighted_mean = mp.weighted_mean('values', 'weights'))) +df = pl.DataFrame( + {"values": [[1, 3, 2], [5, 7], []], "weights": [[0.5, 0.3, 0.2], [0.1, 0.9], []]} +) +print(df.with_columns(weighted_mean=mp.weighted_mean("values", "weights"))) -df = pl.DataFrame({ - 'english': ['foo', 'bar', ''], -}) -print(df.with_columns(pig_latin = mp.pig_latinnify('english'))) +df = pl.DataFrame( + { + "english": ["foo", "bar", ""], + } +) +print(df.with_columns(pig_latin=mp.pig_latinnify("english"))) -df = pl.DataFrame({ - 'values': [1., 3, 2, 5, 7], - 'weights': [.5, .3, .2, .1, .9], - 'group': ['a', 'a', 'a', 'b', 'b'], -}) -print(df.group_by('group').agg(weighted_mean = mp.vertical_weighted_mean('values', 'weights'))) +df = pl.DataFrame( + { + "values": [1.0, 3, 2, 5, 7], + "weights": [0.5, 0.3, 0.2, 0.1, 0.9], + "group": ["a", "a", "a", "b", "b"], + } +) +print( + df.group_by("group").agg( + weighted_mean=mp.vertical_weighted_mean("values", "weights") + ) +) -df = pl.DataFrame({ - 'a': [None, None, 3, None, None, 9, 11, None], -}) -result = df.with_columns(interpolate=mp.interpolate('a')) +df = pl.DataFrame( + { + "a": [None, None, 3, None, None, 9, 11, None], + } +) +result = df.with_columns(interpolate=mp.interpolate("a")) print(result) diff --git a/src/expressions.rs b/src/expressions.rs index 59977ae..d484ae3 100644 --- a/src/expressions.rs +++ b/src/expressions.rs @@ -169,7 +169,7 @@ struct AddSuffixKwargs { fn add_suffix(inputs: &[Series], kwargs: AddSuffixKwargs) -> PolarsResult { let s = &inputs[0]; let ca = s.str()?; - let out = ca.apply_to_buffer(|value, output| { + let out = ca.apply_into_string_amortized(|value, output| { write!(output, "{}{}", value, kwargs.suffix).unwrap(); }); Ok(out.into_series()) @@ -181,7 +181,7 @@ fn add_suffix(inputs: &[Series], kwargs: AddSuffixKwargs) -> PolarsResult PolarsResult { // let ca: &StringChunked = inputs[0].str()?; // let en_stemmer = Stemmer::create(Algorithm::English); -// let out: StringChunked = ca.apply_to_buffer(|value: &str, output: &mut String| { +// let out: StringChunked = ca.apply_into_string_amortized(|value: &str, output: &mut String| { // write!(output, "{}", en_stemmer.stem(value)).unwrap() // }); // Ok(out.into_series()) @@ -241,7 +241,7 @@ fn shifted_struct(input_fields: &[Field]) -> PolarsResult { #[polars_expr(output_type_func=shifted_struct)] fn shift_struct(inputs: &[Series]) -> PolarsResult { let struct_ = inputs[0].struct_()?; - let fields = struct_.fields(); + let fields = struct_.fields_as_series(); if fields.is_empty() { return Ok(inputs[0].clone()); } @@ -257,7 +257,7 @@ fn shift_struct(inputs: &[Series]) -> PolarsResult { }) .collect::>(); fields.push(field_0); - StructChunked::new(struct_.name(), &fields).map(|ca| ca.into_series()) + StructChunked::from_series(struct_.name(), &fields).map(|ca| ca.into_series()) } use polars_arrow::array::MutablePlString; @@ -414,7 +414,7 @@ where } let array = PrimitiveArray::new( - T::get_dtype().to_arrow(true), + T::get_dtype().to_arrow(CompatLevel::newest()), out.into(), Some(validity.into()), );