Files
nushell/crates/nu_plugin_polars/Cargo.toml
Matthias Meschede 05c36d1bc7 add polars join_where command (#15635)
# Description

This adds `polars join_where` which allows joining two dataframes based
on a conditions. The command can be used as:

```
➜ let df_a = [[name cash];[Alice 5] [Bob 10]] | polars into-lazy
➜ let df_b = [[item price];[A 3] [B 7] [C 12]] | polars into-lazy
➜ $df_a | polars join_where $df_b ((polars col cash) > (polars col price)) | polars collect
╭───┬───────┬──────┬──────┬───────╮
│ # │ name  │ cash │ item │ price │
├───┼───────┼──────┼──────┼───────┤
│ 0 │ Bob   │   10 │ B    │     7 │
│ 1 │ Bob   │   10 │ A    │     3 │
│ 2 │ Alice │    5 │ A    │     3 │
╰───┴───────┴──────┴──────┴───────╯
```

# User-Facing Changes

- new command `polars join_where`
2025-04-24 14:44:29 -07:00

107 lines
2.7 KiB
TOML

[package]
authors = ["The Nushell Project Developers"]
description = "Nushell dataframe plugin commands based on polars."
edition = "2021"
license = "MIT"
name = "nu_plugin_polars"
repository = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_polars"
version = "0.103.1"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[bin]]
name = "nu_plugin_polars"
bench = false
[lib]
bench = false
[dependencies]
nu-protocol = { path = "../nu-protocol", version = "0.103.1" }
nu-plugin = { path = "../nu-plugin", version = "0.103.1" }
nu-path = { path = "../nu-path", version = "0.103.1" }
nu-utils = { path = "../nu-utils", version = "0.103.1" }
# Potential dependencies for extras
chrono = { workspace = true, features = [
"std",
"unstable-locales",
], default-features = false }
chrono-tz = "0.10"
fancy-regex = { workspace = true }
indexmap = { version = "2.9" }
num = { version = "0.4" }
serde = { version = "1.0", features = ["derive"] }
sqlparser = { version = "0.53" }
polars-io = { version = "0.46", features = ["avro", "cloud", "aws"] }
polars-arrow = { version = "0.46" }
polars-ops = { version = "0.46", features = ["pivot", "cutqcut"] }
polars-plan = { version = "0.46", features = ["regex"] }
polars-utils = { version = "0.46" }
typetag = "0.2"
env_logger = "0.11.3"
log.workspace = true
uuid = { version = "1.16", features = ["v4", "serde"] }
# Do to a compile error with polars, this included to force the raw dependency
hashbrown = { version = "0.15", features = ["rayon", "serde"] }
# Cloud support
aws-config = { version = "1.5", features = ["sso"] }
aws-credential-types = "1.2"
tokio = { version = "1.44", features = ["full"] }
object_store = { version = "0.11", default-features = false }
url.workspace = true
[dependencies.polars]
features = [
"arg_where",
"bigidx",
"checked_arithmetic",
"cloud",
"concat_str",
"cross_join",
"iejoin",
"csv",
"cum_agg",
"default",
"dtype-categorical",
"dtype-datetime",
"dtype-struct",
"dtype-decimal",
"dtype-i8",
"dtype-i16",
"dtype-u8",
"dtype-u16",
"dynamic_group_by",
"ipc",
"is_in",
"json",
"lazy",
"object",
"parquet",
"pivot",
"random",
"rolling_window",
"rows",
"round_series",
"serde",
"serde-lazy",
"strings",
"string_to_integer",
"streaming",
"timezones",
"temporal",
"to_dummies",
]
optional = false
version = "0.46"
[dev-dependencies]
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.103.1" }
nu-engine = { path = "../nu-engine", version = "0.103.1" }
nu-parser = { path = "../nu-parser", version = "0.103.1" }
nu-command = { path = "../nu-command", version = "0.103.1" }
nu-plugin-test-support = { path = "../nu-plugin-test-support", version = "0.103.1" }
tempfile.workspace = true