From c55b5c0a55896f998d01a0bed6d53fa8a90381c2 Mon Sep 17 00:00:00 2001 From: Michael Angerman <1809991+stormasm@users.noreply.github.com> Date: Fri, 19 May 2023 10:56:08 -0700 Subject: [PATCH] move dataframe commands to nu-cmd-dataframe (#9241) All of the dataframe commands ported over with no issues... ### 11 tests are commented out (for now) So 100 of the original 111 tests are passing with only 11 tests being ignored for now.. As per our conversation in the core team meeting on Wednesday I took @jntrnr suggestion and just commented out the tests dealing with [IntoDatetime](https://github.com/nushell/nushell/blob/main/crates/nu-command/src/conversions/into/mod.rs) Later on we can move this functionality out of nu-command if we decide it makes sense... ### The following tests were ignored... ```rust modified: crates/nu-cmd-dataframe/src/dataframe/series/date/get_day.rs modified: crates/nu-cmd-dataframe/src/dataframe/series/date/get_hour.rs modified: crates/nu-cmd-dataframe/src/dataframe/series/date/get_minute.rs modified: crates/nu-cmd-dataframe/src/dataframe/series/date/get_month.rs modified: crates/nu-cmd-dataframe/src/dataframe/series/date/get_nanosecond.rs modified: crates/nu-cmd-dataframe/src/dataframe/series/date/get_ordinal.rs modified: crates/nu-cmd-dataframe/src/dataframe/series/date/get_second.rs modified: crates/nu-cmd-dataframe/src/dataframe/series/date/get_week.rs modified: crates/nu-cmd-dataframe/src/dataframe/series/date/get_weekday.rs modified: crates/nu-cmd-dataframe/src/dataframe/series/date/get_year.rs modified: crates/nu-cmd-dataframe/src/dataframe/series/string/strftime.rs ``` --- Cargo.lock | 21 +++++- Cargo.toml | 2 + crates/nu-cmd-dataframe/Cargo.toml | 68 +++++++++++++++++++ crates/nu-cmd-dataframe/LICENSE | 21 ++++++ .../src/dataframe/README.md | 0 .../src/dataframe/eager/append.rs | 0 .../src/dataframe/eager/columns.rs | 0 .../src/dataframe/eager/drop.rs | 0 .../src/dataframe/eager/drop_duplicates.rs | 0 .../src/dataframe/eager/drop_nulls.rs | 0 .../src/dataframe/eager/dtypes.rs | 0 .../src/dataframe/eager/dummies.rs | 0 .../src/dataframe/eager/filter_with.rs | 0 .../src/dataframe/eager/first.rs | 0 .../src/dataframe/eager/get.rs | 0 .../src/dataframe/eager/last.rs | 0 .../src/dataframe/eager/list.rs | 0 .../src/dataframe/eager/melt.rs | 0 .../src/dataframe/eager/mod.rs | 0 .../src/dataframe/eager/open.rs | 0 .../src/dataframe/eager/query_df.rs | 0 .../src/dataframe/eager/rename.rs | 0 .../src/dataframe/eager/sample.rs | 0 .../src/dataframe/eager/shape.rs | 0 .../src/dataframe/eager/slice.rs | 0 .../src/dataframe/eager/sql_context.rs | 0 .../src/dataframe/eager/sql_expr.rs | 0 .../src/dataframe/eager/summary.rs | 0 .../src/dataframe/eager/take.rs | 0 .../src/dataframe/eager/to_arrow.rs | 0 .../src/dataframe/eager/to_csv.rs | 0 .../src/dataframe/eager/to_df.rs | 0 .../src/dataframe/eager/to_nu.rs | 0 .../src/dataframe/eager/to_parquet.rs | 0 .../src/dataframe/eager/with_column.rs | 0 .../src/dataframe/expressions/alias.rs | 0 .../src/dataframe/expressions/arg_where.rs | 0 .../src/dataframe/expressions/as_nu.rs | 0 .../src/dataframe/expressions/col.rs | 0 .../src/dataframe/expressions/concat_str.rs | 0 .../expressions/expressions_macro.rs | 0 .../src/dataframe/expressions/is_in.rs | 0 .../src/dataframe/expressions/lit.rs | 0 .../src/dataframe/expressions/mod.rs | 0 .../src/dataframe/expressions/otherwise.rs | 0 .../src/dataframe/expressions/quantile.rs | 0 .../src/dataframe/expressions/when.rs | 0 .../src/dataframe/lazy/aggregate.rs | 0 .../src/dataframe/lazy/collect.rs | 0 .../src/dataframe/lazy/fetch.rs | 0 .../src/dataframe/lazy/fill_nan.rs | 0 .../src/dataframe/lazy/fill_null.rs | 0 .../src/dataframe/lazy/filter.rs | 0 .../src/dataframe/lazy/groupby.rs | 0 .../src/dataframe/lazy/join.rs | 0 .../src/dataframe/lazy/macro_commands.rs | 0 .../src/dataframe/lazy/mod.rs | 0 .../src/dataframe/lazy/quantile.rs | 0 .../src/dataframe/lazy/select.rs | 0 .../src/dataframe/lazy/sort_by_expr.rs | 0 .../src/dataframe/lazy/to_lazy.rs | 0 .../src/dataframe/mod.rs | 0 .../src/dataframe/series/all_false.rs | 0 .../src/dataframe/series/all_true.rs | 0 .../src/dataframe/series/arg_max.rs | 0 .../src/dataframe/series/arg_min.rs | 0 .../src/dataframe/series/cumulative.rs | 0 .../src/dataframe/series/date/as_date.rs | 0 .../src/dataframe/series/date/as_datetime.rs | 0 .../src/dataframe/series/date/get_day.rs | 2 +- .../src/dataframe/series/date/get_hour.rs | 2 +- .../src/dataframe/series/date/get_minute.rs | 2 +- .../src/dataframe/series/date/get_month.rs | 2 +- .../dataframe/series/date/get_nanosecond.rs | 2 +- .../src/dataframe/series/date/get_ordinal.rs | 2 +- .../src/dataframe/series/date/get_second.rs | 2 +- .../src/dataframe/series/date/get_week.rs | 2 +- .../src/dataframe/series/date/get_weekday.rs | 2 +- .../src/dataframe/series/date/get_year.rs | 2 +- .../src/dataframe/series/date/mod.rs | 0 .../src/dataframe/series/indexes/arg_sort.rs | 0 .../src/dataframe/series/indexes/arg_true.rs | 0 .../dataframe/series/indexes/arg_unique.rs | 0 .../src/dataframe/series/indexes/mod.rs | 0 .../dataframe/series/indexes/set_with_idx.rs | 0 .../dataframe/series/masks/is_duplicated.rs | 0 .../src/dataframe/series/masks/is_in.rs | 0 .../src/dataframe/series/masks/is_not_null.rs | 0 .../src/dataframe/series/masks/is_null.rs | 0 .../src/dataframe/series/masks/is_unique.rs | 0 .../src/dataframe/series/masks/mod.rs | 0 .../src/dataframe/series/masks/not.rs | 0 .../src/dataframe/series/masks/set.rs | 0 .../src/dataframe/series/mod.rs | 0 .../src/dataframe/series/n_null.rs | 0 .../src/dataframe/series/n_unique.rs | 0 .../src/dataframe/series/rolling.rs | 0 .../src/dataframe/series/shift.rs | 0 .../dataframe/series/string/concatenate.rs | 0 .../src/dataframe/series/string/contains.rs | 0 .../src/dataframe/series/string/mod.rs | 0 .../src/dataframe/series/string/replace.rs | 0 .../dataframe/series/string/replace_all.rs | 0 .../dataframe/series/string/str_lengths.rs | 0 .../src/dataframe/series/string/str_slice.rs | 0 .../src/dataframe/series/string/strftime.rs | 3 +- .../dataframe/series/string/to_lowercase.rs | 0 .../dataframe/series/string/to_uppercase.rs | 0 .../src/dataframe/series/unique.rs | 0 .../src/dataframe/series/value_counts.rs | 0 .../src/dataframe/test_dataframe.rs | 0 .../src/dataframe/utils.rs | 0 .../src/dataframe/values/mod.rs | 0 .../values/nu_dataframe/between_values.rs | 0 .../values/nu_dataframe/conversion.rs | 0 .../values/nu_dataframe/custom_value.rs | 0 .../src/dataframe/values/nu_dataframe/mod.rs | 0 .../values/nu_dataframe/operations.rs | 0 .../values/nu_expression/custom_value.rs | 0 .../src/dataframe/values/nu_expression/mod.rs | 0 .../values/nu_lazyframe/custom_value.rs | 0 .../src/dataframe/values/nu_lazyframe/mod.rs | 0 .../values/nu_lazygroupby/custom_value.rs | 0 .../dataframe/values/nu_lazygroupby/mod.rs | 0 .../dataframe/values/nu_when/custom_value.rs | 0 .../src/dataframe/values/nu_when/mod.rs | 0 .../src/dataframe/values/utils.rs | 0 crates/nu-cmd-dataframe/src/lib.rs | 2 + crates/nu-command/Cargo.toml | 34 +--------- crates/nu-command/src/default_context.rs | 2 + crates/nu-command/src/lib.rs | 6 -- 131 files changed, 128 insertions(+), 51 deletions(-) create mode 100644 crates/nu-cmd-dataframe/Cargo.toml create mode 100644 crates/nu-cmd-dataframe/LICENSE rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/README.md (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/append.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/columns.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/drop.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/drop_duplicates.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/drop_nulls.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/dtypes.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/dummies.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/filter_with.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/first.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/get.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/last.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/list.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/melt.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/mod.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/open.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/query_df.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/rename.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/sample.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/shape.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/slice.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/sql_context.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/sql_expr.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/summary.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/take.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/to_arrow.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/to_csv.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/to_df.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/to_nu.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/to_parquet.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/eager/with_column.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/expressions/alias.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/expressions/arg_where.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/expressions/as_nu.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/expressions/col.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/expressions/concat_str.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/expressions/expressions_macro.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/expressions/is_in.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/expressions/lit.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/expressions/mod.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/expressions/otherwise.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/expressions/quantile.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/expressions/when.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/lazy/aggregate.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/lazy/collect.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/lazy/fetch.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/lazy/fill_nan.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/lazy/fill_null.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/lazy/filter.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/lazy/groupby.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/lazy/join.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/lazy/macro_commands.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/lazy/mod.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/lazy/quantile.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/lazy/select.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/lazy/sort_by_expr.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/lazy/to_lazy.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/mod.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/all_false.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/all_true.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/arg_max.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/arg_min.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/cumulative.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/date/as_date.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/date/as_datetime.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/date/get_day.rs (98%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/date/get_hour.rs (98%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/date/get_minute.rs (98%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/date/get_month.rs (98%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/date/get_nanosecond.rs (98%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/date/get_ordinal.rs (98%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/date/get_second.rs (98%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/date/get_week.rs (98%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/date/get_weekday.rs (98%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/date/get_year.rs (98%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/date/mod.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/indexes/arg_sort.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/indexes/arg_true.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/indexes/arg_unique.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/indexes/mod.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/indexes/set_with_idx.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/masks/is_duplicated.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/masks/is_in.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/masks/is_not_null.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/masks/is_null.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/masks/is_unique.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/masks/mod.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/masks/not.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/masks/set.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/mod.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/n_null.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/n_unique.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/rolling.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/shift.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/string/concatenate.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/string/contains.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/string/mod.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/string/replace.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/string/replace_all.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/string/str_lengths.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/string/str_slice.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/string/strftime.rs (98%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/string/to_lowercase.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/string/to_uppercase.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/unique.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/series/value_counts.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/test_dataframe.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/utils.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/values/mod.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/values/nu_dataframe/between_values.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/values/nu_dataframe/conversion.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/values/nu_dataframe/custom_value.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/values/nu_dataframe/mod.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/values/nu_dataframe/operations.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/values/nu_expression/custom_value.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/values/nu_expression/mod.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/values/nu_lazyframe/custom_value.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/values/nu_lazyframe/mod.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/values/nu_lazygroupby/custom_value.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/values/nu_lazygroupby/mod.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/values/nu_when/custom_value.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/values/nu_when/mod.rs (100%) rename crates/{nu-command => nu-cmd-dataframe}/src/dataframe/values/utils.rs (100%) create mode 100644 crates/nu-cmd-dataframe/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 961ca8a8a..5b2078b0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2611,6 +2611,7 @@ dependencies = [ "nix", "nu-ansi-term", "nu-cli", + "nu-cmd-dataframe", "nu-cmd-lang", "nu-color-config", "nu-command", @@ -2678,6 +2679,24 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "nu-cmd-dataframe" +version = "0.80.1" +dependencies = [ + "chrono", + "fancy-regex", + "indexmap", + "nu-cmd-lang", + "nu-engine", + "nu-parser", + "nu-protocol", + "nu-test-support", + "num 0.4.0", + "polars", + "serde", + "sqlparser 0.32.0", +] + [[package]] name = "nu-cmd-lang" version = "0.80.1" @@ -2747,6 +2766,7 @@ dependencies = [ "native-tls", "notify", "nu-ansi-term", + "nu-cmd-dataframe", "nu-cmd-lang", "nu-color-config", "nu-engine", @@ -2770,7 +2790,6 @@ dependencies = [ "os_pipe", "pathdiff", "percent-encoding", - "polars", "powierza-coefficient", "print-positions", "quick-xml 0.28.2", diff --git a/Cargo.toml b/Cargo.toml index f32a9b79c..537c63d49 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,6 +28,7 @@ members = [ "crates/nu-parser", "crates/nu-system", "crates/nu-cmd-lang", + "crates/nu-cmd-dataframe", "crates/nu-command", "crates/nu-protocol", "crates/nu-plugin", @@ -45,6 +46,7 @@ members = [ nu-cli = { path = "./crates/nu-cli", version = "0.80.1" } nu-color-config = { path = "./crates/nu-color-config", version = "0.80.1" } nu-cmd-lang = { path = "./crates/nu-cmd-lang", version = "0.80.1" } +nu-cmd-dataframe = { path = "./crates/nu-cmd-dataframe", version = "0.80.1", optional = true } nu-command = { path = "./crates/nu-command", version = "0.80.1" } nu-engine = { path = "./crates/nu-engine", version = "0.80.1" } nu-json = { path = "./crates/nu-json", version = "0.80.1" } diff --git a/crates/nu-cmd-dataframe/Cargo.toml b/crates/nu-cmd-dataframe/Cargo.toml new file mode 100644 index 000000000..7ee3989cc --- /dev/null +++ b/crates/nu-cmd-dataframe/Cargo.toml @@ -0,0 +1,68 @@ +[package] +authors = ["The Nushell Project Developers"] +description = "Nushell's dataframe commands based on polars." +edition = "2021" +license = "MIT" +name = "nu-cmd-dataframe" +repository = "https://github.com/nushell/nushell/tree/main/crates/nu-cmd-dataframe" +version = "0.80.1" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[lib] +bench = false + +[dependencies] +nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.80.1" } +nu-engine = { path = "../nu-engine", version = "0.80.1" } +nu-parser = { path = "../nu-parser", version = "0.80.1" } +nu-protocol = { path = "../nu-protocol", version = "0.80.1" } + +# Potential dependencies for extras +chrono = { version = "0.4.23", features = [ + "std", + "unstable-locales", +], default-features = false } +fancy-regex = "0.11.0" +indexmap = { version = "1.7", features = ["serde-1"] } +num = { version = "0.4.0", optional = true } +serde = { version = "1.0.123", features = ["derive"] } +sqlparser = { version = "0.32.0", features = ["serde"], optional = true } + +[dependencies.polars] +features = [ + "arg_where", + "checked_arithmetic", + "concat_str", + "cross_join", + "csv", + "cum_agg", + "default", + "dtype-categorical", + "dtype-datetime", + "dtype-struct", + "dynamic_groupby", + "ipc", + "is_in", + "json", + "lazy", + "object", + "parquet", + "random", + "rolling_window", + "rows", + "serde", + "serde-lazy", + "strings", + "strings", + "to_dummies", +] +optional = true +version = "0.29.0" + +[features] +dataframe = ["default"] +default = ["num", "polars", "sqlparser"] + +[dev-dependencies] +nu-test-support = { path = "../nu-test-support", version = "0.80.1" } diff --git a/crates/nu-cmd-dataframe/LICENSE b/crates/nu-cmd-dataframe/LICENSE new file mode 100644 index 000000000..ae174e859 --- /dev/null +++ b/crates/nu-cmd-dataframe/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 - 2023 The Nushell Project Developers + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/crates/nu-command/src/dataframe/README.md b/crates/nu-cmd-dataframe/src/dataframe/README.md similarity index 100% rename from crates/nu-command/src/dataframe/README.md rename to crates/nu-cmd-dataframe/src/dataframe/README.md diff --git a/crates/nu-command/src/dataframe/eager/append.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/append.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/append.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/append.rs diff --git a/crates/nu-command/src/dataframe/eager/columns.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/columns.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/columns.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/columns.rs diff --git a/crates/nu-command/src/dataframe/eager/drop.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/drop.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/drop.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/drop.rs diff --git a/crates/nu-command/src/dataframe/eager/drop_duplicates.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/drop_duplicates.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/drop_duplicates.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/drop_duplicates.rs diff --git a/crates/nu-command/src/dataframe/eager/drop_nulls.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/drop_nulls.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/drop_nulls.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/drop_nulls.rs diff --git a/crates/nu-command/src/dataframe/eager/dtypes.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/dtypes.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/dtypes.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/dtypes.rs diff --git a/crates/nu-command/src/dataframe/eager/dummies.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/dummies.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/dummies.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/dummies.rs diff --git a/crates/nu-command/src/dataframe/eager/filter_with.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/filter_with.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/filter_with.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/filter_with.rs diff --git a/crates/nu-command/src/dataframe/eager/first.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/first.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/first.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/first.rs diff --git a/crates/nu-command/src/dataframe/eager/get.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/get.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/get.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/get.rs diff --git a/crates/nu-command/src/dataframe/eager/last.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/last.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/last.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/last.rs diff --git a/crates/nu-command/src/dataframe/eager/list.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/list.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/list.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/list.rs diff --git a/crates/nu-command/src/dataframe/eager/melt.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/melt.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/melt.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/melt.rs diff --git a/crates/nu-command/src/dataframe/eager/mod.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/mod.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/mod.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/mod.rs diff --git a/crates/nu-command/src/dataframe/eager/open.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/open.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/open.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/open.rs diff --git a/crates/nu-command/src/dataframe/eager/query_df.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/query_df.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/query_df.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/query_df.rs diff --git a/crates/nu-command/src/dataframe/eager/rename.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/rename.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/rename.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/rename.rs diff --git a/crates/nu-command/src/dataframe/eager/sample.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/sample.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/sample.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/sample.rs diff --git a/crates/nu-command/src/dataframe/eager/shape.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/shape.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/shape.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/shape.rs diff --git a/crates/nu-command/src/dataframe/eager/slice.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/slice.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/slice.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/slice.rs diff --git a/crates/nu-command/src/dataframe/eager/sql_context.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/sql_context.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/sql_context.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/sql_context.rs diff --git a/crates/nu-command/src/dataframe/eager/sql_expr.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/sql_expr.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/sql_expr.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/sql_expr.rs diff --git a/crates/nu-command/src/dataframe/eager/summary.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/summary.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/summary.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/summary.rs diff --git a/crates/nu-command/src/dataframe/eager/take.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/take.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/take.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/take.rs diff --git a/crates/nu-command/src/dataframe/eager/to_arrow.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/to_arrow.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/to_arrow.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/to_arrow.rs diff --git a/crates/nu-command/src/dataframe/eager/to_csv.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/to_csv.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/to_csv.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/to_csv.rs diff --git a/crates/nu-command/src/dataframe/eager/to_df.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/to_df.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/to_df.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/to_df.rs diff --git a/crates/nu-command/src/dataframe/eager/to_nu.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/to_nu.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/to_nu.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/to_nu.rs diff --git a/crates/nu-command/src/dataframe/eager/to_parquet.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/to_parquet.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/to_parquet.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/to_parquet.rs diff --git a/crates/nu-command/src/dataframe/eager/with_column.rs b/crates/nu-cmd-dataframe/src/dataframe/eager/with_column.rs similarity index 100% rename from crates/nu-command/src/dataframe/eager/with_column.rs rename to crates/nu-cmd-dataframe/src/dataframe/eager/with_column.rs diff --git a/crates/nu-command/src/dataframe/expressions/alias.rs b/crates/nu-cmd-dataframe/src/dataframe/expressions/alias.rs similarity index 100% rename from crates/nu-command/src/dataframe/expressions/alias.rs rename to crates/nu-cmd-dataframe/src/dataframe/expressions/alias.rs diff --git a/crates/nu-command/src/dataframe/expressions/arg_where.rs b/crates/nu-cmd-dataframe/src/dataframe/expressions/arg_where.rs similarity index 100% rename from crates/nu-command/src/dataframe/expressions/arg_where.rs rename to crates/nu-cmd-dataframe/src/dataframe/expressions/arg_where.rs diff --git a/crates/nu-command/src/dataframe/expressions/as_nu.rs b/crates/nu-cmd-dataframe/src/dataframe/expressions/as_nu.rs similarity index 100% rename from crates/nu-command/src/dataframe/expressions/as_nu.rs rename to crates/nu-cmd-dataframe/src/dataframe/expressions/as_nu.rs diff --git a/crates/nu-command/src/dataframe/expressions/col.rs b/crates/nu-cmd-dataframe/src/dataframe/expressions/col.rs similarity index 100% rename from crates/nu-command/src/dataframe/expressions/col.rs rename to crates/nu-cmd-dataframe/src/dataframe/expressions/col.rs diff --git a/crates/nu-command/src/dataframe/expressions/concat_str.rs b/crates/nu-cmd-dataframe/src/dataframe/expressions/concat_str.rs similarity index 100% rename from crates/nu-command/src/dataframe/expressions/concat_str.rs rename to crates/nu-cmd-dataframe/src/dataframe/expressions/concat_str.rs diff --git a/crates/nu-command/src/dataframe/expressions/expressions_macro.rs b/crates/nu-cmd-dataframe/src/dataframe/expressions/expressions_macro.rs similarity index 100% rename from crates/nu-command/src/dataframe/expressions/expressions_macro.rs rename to crates/nu-cmd-dataframe/src/dataframe/expressions/expressions_macro.rs diff --git a/crates/nu-command/src/dataframe/expressions/is_in.rs b/crates/nu-cmd-dataframe/src/dataframe/expressions/is_in.rs similarity index 100% rename from crates/nu-command/src/dataframe/expressions/is_in.rs rename to crates/nu-cmd-dataframe/src/dataframe/expressions/is_in.rs diff --git a/crates/nu-command/src/dataframe/expressions/lit.rs b/crates/nu-cmd-dataframe/src/dataframe/expressions/lit.rs similarity index 100% rename from crates/nu-command/src/dataframe/expressions/lit.rs rename to crates/nu-cmd-dataframe/src/dataframe/expressions/lit.rs diff --git a/crates/nu-command/src/dataframe/expressions/mod.rs b/crates/nu-cmd-dataframe/src/dataframe/expressions/mod.rs similarity index 100% rename from crates/nu-command/src/dataframe/expressions/mod.rs rename to crates/nu-cmd-dataframe/src/dataframe/expressions/mod.rs diff --git a/crates/nu-command/src/dataframe/expressions/otherwise.rs b/crates/nu-cmd-dataframe/src/dataframe/expressions/otherwise.rs similarity index 100% rename from crates/nu-command/src/dataframe/expressions/otherwise.rs rename to crates/nu-cmd-dataframe/src/dataframe/expressions/otherwise.rs diff --git a/crates/nu-command/src/dataframe/expressions/quantile.rs b/crates/nu-cmd-dataframe/src/dataframe/expressions/quantile.rs similarity index 100% rename from crates/nu-command/src/dataframe/expressions/quantile.rs rename to crates/nu-cmd-dataframe/src/dataframe/expressions/quantile.rs diff --git a/crates/nu-command/src/dataframe/expressions/when.rs b/crates/nu-cmd-dataframe/src/dataframe/expressions/when.rs similarity index 100% rename from crates/nu-command/src/dataframe/expressions/when.rs rename to crates/nu-cmd-dataframe/src/dataframe/expressions/when.rs diff --git a/crates/nu-command/src/dataframe/lazy/aggregate.rs b/crates/nu-cmd-dataframe/src/dataframe/lazy/aggregate.rs similarity index 100% rename from crates/nu-command/src/dataframe/lazy/aggregate.rs rename to crates/nu-cmd-dataframe/src/dataframe/lazy/aggregate.rs diff --git a/crates/nu-command/src/dataframe/lazy/collect.rs b/crates/nu-cmd-dataframe/src/dataframe/lazy/collect.rs similarity index 100% rename from crates/nu-command/src/dataframe/lazy/collect.rs rename to crates/nu-cmd-dataframe/src/dataframe/lazy/collect.rs diff --git a/crates/nu-command/src/dataframe/lazy/fetch.rs b/crates/nu-cmd-dataframe/src/dataframe/lazy/fetch.rs similarity index 100% rename from crates/nu-command/src/dataframe/lazy/fetch.rs rename to crates/nu-cmd-dataframe/src/dataframe/lazy/fetch.rs diff --git a/crates/nu-command/src/dataframe/lazy/fill_nan.rs b/crates/nu-cmd-dataframe/src/dataframe/lazy/fill_nan.rs similarity index 100% rename from crates/nu-command/src/dataframe/lazy/fill_nan.rs rename to crates/nu-cmd-dataframe/src/dataframe/lazy/fill_nan.rs diff --git a/crates/nu-command/src/dataframe/lazy/fill_null.rs b/crates/nu-cmd-dataframe/src/dataframe/lazy/fill_null.rs similarity index 100% rename from crates/nu-command/src/dataframe/lazy/fill_null.rs rename to crates/nu-cmd-dataframe/src/dataframe/lazy/fill_null.rs diff --git a/crates/nu-command/src/dataframe/lazy/filter.rs b/crates/nu-cmd-dataframe/src/dataframe/lazy/filter.rs similarity index 100% rename from crates/nu-command/src/dataframe/lazy/filter.rs rename to crates/nu-cmd-dataframe/src/dataframe/lazy/filter.rs diff --git a/crates/nu-command/src/dataframe/lazy/groupby.rs b/crates/nu-cmd-dataframe/src/dataframe/lazy/groupby.rs similarity index 100% rename from crates/nu-command/src/dataframe/lazy/groupby.rs rename to crates/nu-cmd-dataframe/src/dataframe/lazy/groupby.rs diff --git a/crates/nu-command/src/dataframe/lazy/join.rs b/crates/nu-cmd-dataframe/src/dataframe/lazy/join.rs similarity index 100% rename from crates/nu-command/src/dataframe/lazy/join.rs rename to crates/nu-cmd-dataframe/src/dataframe/lazy/join.rs diff --git a/crates/nu-command/src/dataframe/lazy/macro_commands.rs b/crates/nu-cmd-dataframe/src/dataframe/lazy/macro_commands.rs similarity index 100% rename from crates/nu-command/src/dataframe/lazy/macro_commands.rs rename to crates/nu-cmd-dataframe/src/dataframe/lazy/macro_commands.rs diff --git a/crates/nu-command/src/dataframe/lazy/mod.rs b/crates/nu-cmd-dataframe/src/dataframe/lazy/mod.rs similarity index 100% rename from crates/nu-command/src/dataframe/lazy/mod.rs rename to crates/nu-cmd-dataframe/src/dataframe/lazy/mod.rs diff --git a/crates/nu-command/src/dataframe/lazy/quantile.rs b/crates/nu-cmd-dataframe/src/dataframe/lazy/quantile.rs similarity index 100% rename from crates/nu-command/src/dataframe/lazy/quantile.rs rename to crates/nu-cmd-dataframe/src/dataframe/lazy/quantile.rs diff --git a/crates/nu-command/src/dataframe/lazy/select.rs b/crates/nu-cmd-dataframe/src/dataframe/lazy/select.rs similarity index 100% rename from crates/nu-command/src/dataframe/lazy/select.rs rename to crates/nu-cmd-dataframe/src/dataframe/lazy/select.rs diff --git a/crates/nu-command/src/dataframe/lazy/sort_by_expr.rs b/crates/nu-cmd-dataframe/src/dataframe/lazy/sort_by_expr.rs similarity index 100% rename from crates/nu-command/src/dataframe/lazy/sort_by_expr.rs rename to crates/nu-cmd-dataframe/src/dataframe/lazy/sort_by_expr.rs diff --git a/crates/nu-command/src/dataframe/lazy/to_lazy.rs b/crates/nu-cmd-dataframe/src/dataframe/lazy/to_lazy.rs similarity index 100% rename from crates/nu-command/src/dataframe/lazy/to_lazy.rs rename to crates/nu-cmd-dataframe/src/dataframe/lazy/to_lazy.rs diff --git a/crates/nu-command/src/dataframe/mod.rs b/crates/nu-cmd-dataframe/src/dataframe/mod.rs similarity index 100% rename from crates/nu-command/src/dataframe/mod.rs rename to crates/nu-cmd-dataframe/src/dataframe/mod.rs diff --git a/crates/nu-command/src/dataframe/series/all_false.rs b/crates/nu-cmd-dataframe/src/dataframe/series/all_false.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/all_false.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/all_false.rs diff --git a/crates/nu-command/src/dataframe/series/all_true.rs b/crates/nu-cmd-dataframe/src/dataframe/series/all_true.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/all_true.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/all_true.rs diff --git a/crates/nu-command/src/dataframe/series/arg_max.rs b/crates/nu-cmd-dataframe/src/dataframe/series/arg_max.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/arg_max.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/arg_max.rs diff --git a/crates/nu-command/src/dataframe/series/arg_min.rs b/crates/nu-cmd-dataframe/src/dataframe/series/arg_min.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/arg_min.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/arg_min.rs diff --git a/crates/nu-command/src/dataframe/series/cumulative.rs b/crates/nu-cmd-dataframe/src/dataframe/series/cumulative.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/cumulative.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/cumulative.rs diff --git a/crates/nu-command/src/dataframe/series/date/as_date.rs b/crates/nu-cmd-dataframe/src/dataframe/series/date/as_date.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/date/as_date.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/date/as_date.rs diff --git a/crates/nu-command/src/dataframe/series/date/as_datetime.rs b/crates/nu-cmd-dataframe/src/dataframe/series/date/as_datetime.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/date/as_datetime.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/date/as_datetime.rs diff --git a/crates/nu-command/src/dataframe/series/date/get_day.rs b/crates/nu-cmd-dataframe/src/dataframe/series/date/get_day.rs similarity index 98% rename from crates/nu-command/src/dataframe/series/date/get_day.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/date/get_day.rs index 65c21d3ea..f7af95ec7 100644 --- a/crates/nu-command/src/dataframe/series/date/get_day.rs +++ b/crates/nu-cmd-dataframe/src/dataframe/series/date/get_day.rs @@ -79,7 +79,7 @@ fn command( .map(|df| PipelineData::Value(NuDataFrame::into_value(df, call.head), None)) } -#[cfg(test)] +#[cfg(explore_refactor_IntoDatetime)] mod test { use super::super::super::super::super::IntoDatetime; use super::super::super::super::test_dataframe::test_dataframe; diff --git a/crates/nu-command/src/dataframe/series/date/get_hour.rs b/crates/nu-cmd-dataframe/src/dataframe/series/date/get_hour.rs similarity index 98% rename from crates/nu-command/src/dataframe/series/date/get_hour.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/date/get_hour.rs index bca8e607d..2731f582a 100644 --- a/crates/nu-command/src/dataframe/series/date/get_hour.rs +++ b/crates/nu-cmd-dataframe/src/dataframe/series/date/get_hour.rs @@ -79,7 +79,7 @@ fn command( .map(|df| PipelineData::Value(NuDataFrame::into_value(df, call.head), None)) } -#[cfg(test)] +#[cfg(explore_refactor_IntoDatetime)] mod test { use super::super::super::super::super::IntoDatetime; use super::super::super::super::test_dataframe::test_dataframe; diff --git a/crates/nu-command/src/dataframe/series/date/get_minute.rs b/crates/nu-cmd-dataframe/src/dataframe/series/date/get_minute.rs similarity index 98% rename from crates/nu-command/src/dataframe/series/date/get_minute.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/date/get_minute.rs index d2d8bd96e..86d3867d5 100644 --- a/crates/nu-command/src/dataframe/series/date/get_minute.rs +++ b/crates/nu-cmd-dataframe/src/dataframe/series/date/get_minute.rs @@ -79,7 +79,7 @@ fn command( .map(|df| PipelineData::Value(NuDataFrame::into_value(df, call.head), None)) } -#[cfg(test)] +#[cfg(explore_refactor_IntoDatetime)] mod test { use super::super::super::super::super::IntoDatetime; use super::super::super::super::test_dataframe::test_dataframe; diff --git a/crates/nu-command/src/dataframe/series/date/get_month.rs b/crates/nu-cmd-dataframe/src/dataframe/series/date/get_month.rs similarity index 98% rename from crates/nu-command/src/dataframe/series/date/get_month.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/date/get_month.rs index 244765e01..d26afb2a4 100644 --- a/crates/nu-command/src/dataframe/series/date/get_month.rs +++ b/crates/nu-cmd-dataframe/src/dataframe/series/date/get_month.rs @@ -79,7 +79,7 @@ fn command( .map(|df| PipelineData::Value(NuDataFrame::into_value(df, call.head), None)) } -#[cfg(test)] +#[cfg(explore_refactor_IntoDatetime)] mod test { use super::super::super::super::super::IntoDatetime; use super::super::super::super::test_dataframe::test_dataframe; diff --git a/crates/nu-command/src/dataframe/series/date/get_nanosecond.rs b/crates/nu-cmd-dataframe/src/dataframe/series/date/get_nanosecond.rs similarity index 98% rename from crates/nu-command/src/dataframe/series/date/get_nanosecond.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/date/get_nanosecond.rs index ec3ed8592..8a3b07428 100644 --- a/crates/nu-command/src/dataframe/series/date/get_nanosecond.rs +++ b/crates/nu-cmd-dataframe/src/dataframe/series/date/get_nanosecond.rs @@ -79,7 +79,7 @@ fn command( .map(|df| PipelineData::Value(NuDataFrame::into_value(df, call.head), None)) } -#[cfg(test)] +#[cfg(explore_refactor_IntoDatetime)] mod test { use super::super::super::super::super::IntoDatetime; use super::super::super::super::test_dataframe::test_dataframe; diff --git a/crates/nu-command/src/dataframe/series/date/get_ordinal.rs b/crates/nu-cmd-dataframe/src/dataframe/series/date/get_ordinal.rs similarity index 98% rename from crates/nu-command/src/dataframe/series/date/get_ordinal.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/date/get_ordinal.rs index bad2b936a..399685c1e 100644 --- a/crates/nu-command/src/dataframe/series/date/get_ordinal.rs +++ b/crates/nu-cmd-dataframe/src/dataframe/series/date/get_ordinal.rs @@ -79,7 +79,7 @@ fn command( .map(|df| PipelineData::Value(NuDataFrame::into_value(df, call.head), None)) } -#[cfg(test)] +#[cfg(explore_refactor_IntoDatetime)] mod test { use super::super::super::super::super::IntoDatetime; use super::super::super::super::test_dataframe::test_dataframe; diff --git a/crates/nu-command/src/dataframe/series/date/get_second.rs b/crates/nu-cmd-dataframe/src/dataframe/series/date/get_second.rs similarity index 98% rename from crates/nu-command/src/dataframe/series/date/get_second.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/date/get_second.rs index 60cf11a53..7a77ee4ae 100644 --- a/crates/nu-command/src/dataframe/series/date/get_second.rs +++ b/crates/nu-cmd-dataframe/src/dataframe/series/date/get_second.rs @@ -79,7 +79,7 @@ fn command( .map(|df| PipelineData::Value(NuDataFrame::into_value(df, call.head), None)) } -#[cfg(test)] +#[cfg(explore_refactor_IntoDatetime)] mod test { use super::super::super::super::super::IntoDatetime; use super::super::super::super::test_dataframe::test_dataframe; diff --git a/crates/nu-command/src/dataframe/series/date/get_week.rs b/crates/nu-cmd-dataframe/src/dataframe/series/date/get_week.rs similarity index 98% rename from crates/nu-command/src/dataframe/series/date/get_week.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/date/get_week.rs index c269b3b04..115a027c2 100644 --- a/crates/nu-command/src/dataframe/series/date/get_week.rs +++ b/crates/nu-cmd-dataframe/src/dataframe/series/date/get_week.rs @@ -79,7 +79,7 @@ fn command( .map(|df| PipelineData::Value(NuDataFrame::into_value(df, call.head), None)) } -#[cfg(test)] +#[cfg(explore_refactor_IntoDatetime)] mod test { use super::super::super::super::super::IntoDatetime; use super::super::super::super::test_dataframe::test_dataframe; diff --git a/crates/nu-command/src/dataframe/series/date/get_weekday.rs b/crates/nu-cmd-dataframe/src/dataframe/series/date/get_weekday.rs similarity index 98% rename from crates/nu-command/src/dataframe/series/date/get_weekday.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/date/get_weekday.rs index d93211b34..906c812de 100644 --- a/crates/nu-command/src/dataframe/series/date/get_weekday.rs +++ b/crates/nu-cmd-dataframe/src/dataframe/series/date/get_weekday.rs @@ -79,7 +79,7 @@ fn command( .map(|df| PipelineData::Value(NuDataFrame::into_value(df, call.head), None)) } -#[cfg(test)] +#[cfg(explore_refactor_IntoDatetime)] mod test { use super::super::super::super::super::IntoDatetime; use super::super::super::super::test_dataframe::test_dataframe; diff --git a/crates/nu-command/src/dataframe/series/date/get_year.rs b/crates/nu-cmd-dataframe/src/dataframe/series/date/get_year.rs similarity index 98% rename from crates/nu-command/src/dataframe/series/date/get_year.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/date/get_year.rs index bd97bc768..b31e949c0 100644 --- a/crates/nu-command/src/dataframe/series/date/get_year.rs +++ b/crates/nu-cmd-dataframe/src/dataframe/series/date/get_year.rs @@ -79,7 +79,7 @@ fn command( .map(|df| PipelineData::Value(NuDataFrame::into_value(df, call.head), None)) } -#[cfg(test)] +#[cfg(explore_refactor_IntoDatetime)] mod test { use super::super::super::super::super::IntoDatetime; use super::super::super::super::test_dataframe::test_dataframe; diff --git a/crates/nu-command/src/dataframe/series/date/mod.rs b/crates/nu-cmd-dataframe/src/dataframe/series/date/mod.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/date/mod.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/date/mod.rs diff --git a/crates/nu-command/src/dataframe/series/indexes/arg_sort.rs b/crates/nu-cmd-dataframe/src/dataframe/series/indexes/arg_sort.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/indexes/arg_sort.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/indexes/arg_sort.rs diff --git a/crates/nu-command/src/dataframe/series/indexes/arg_true.rs b/crates/nu-cmd-dataframe/src/dataframe/series/indexes/arg_true.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/indexes/arg_true.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/indexes/arg_true.rs diff --git a/crates/nu-command/src/dataframe/series/indexes/arg_unique.rs b/crates/nu-cmd-dataframe/src/dataframe/series/indexes/arg_unique.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/indexes/arg_unique.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/indexes/arg_unique.rs diff --git a/crates/nu-command/src/dataframe/series/indexes/mod.rs b/crates/nu-cmd-dataframe/src/dataframe/series/indexes/mod.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/indexes/mod.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/indexes/mod.rs diff --git a/crates/nu-command/src/dataframe/series/indexes/set_with_idx.rs b/crates/nu-cmd-dataframe/src/dataframe/series/indexes/set_with_idx.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/indexes/set_with_idx.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/indexes/set_with_idx.rs diff --git a/crates/nu-command/src/dataframe/series/masks/is_duplicated.rs b/crates/nu-cmd-dataframe/src/dataframe/series/masks/is_duplicated.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/masks/is_duplicated.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/masks/is_duplicated.rs diff --git a/crates/nu-command/src/dataframe/series/masks/is_in.rs b/crates/nu-cmd-dataframe/src/dataframe/series/masks/is_in.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/masks/is_in.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/masks/is_in.rs diff --git a/crates/nu-command/src/dataframe/series/masks/is_not_null.rs b/crates/nu-cmd-dataframe/src/dataframe/series/masks/is_not_null.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/masks/is_not_null.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/masks/is_not_null.rs diff --git a/crates/nu-command/src/dataframe/series/masks/is_null.rs b/crates/nu-cmd-dataframe/src/dataframe/series/masks/is_null.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/masks/is_null.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/masks/is_null.rs diff --git a/crates/nu-command/src/dataframe/series/masks/is_unique.rs b/crates/nu-cmd-dataframe/src/dataframe/series/masks/is_unique.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/masks/is_unique.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/masks/is_unique.rs diff --git a/crates/nu-command/src/dataframe/series/masks/mod.rs b/crates/nu-cmd-dataframe/src/dataframe/series/masks/mod.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/masks/mod.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/masks/mod.rs diff --git a/crates/nu-command/src/dataframe/series/masks/not.rs b/crates/nu-cmd-dataframe/src/dataframe/series/masks/not.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/masks/not.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/masks/not.rs diff --git a/crates/nu-command/src/dataframe/series/masks/set.rs b/crates/nu-cmd-dataframe/src/dataframe/series/masks/set.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/masks/set.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/masks/set.rs diff --git a/crates/nu-command/src/dataframe/series/mod.rs b/crates/nu-cmd-dataframe/src/dataframe/series/mod.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/mod.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/mod.rs diff --git a/crates/nu-command/src/dataframe/series/n_null.rs b/crates/nu-cmd-dataframe/src/dataframe/series/n_null.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/n_null.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/n_null.rs diff --git a/crates/nu-command/src/dataframe/series/n_unique.rs b/crates/nu-cmd-dataframe/src/dataframe/series/n_unique.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/n_unique.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/n_unique.rs diff --git a/crates/nu-command/src/dataframe/series/rolling.rs b/crates/nu-cmd-dataframe/src/dataframe/series/rolling.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/rolling.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/rolling.rs diff --git a/crates/nu-command/src/dataframe/series/shift.rs b/crates/nu-cmd-dataframe/src/dataframe/series/shift.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/shift.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/shift.rs diff --git a/crates/nu-command/src/dataframe/series/string/concatenate.rs b/crates/nu-cmd-dataframe/src/dataframe/series/string/concatenate.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/string/concatenate.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/string/concatenate.rs diff --git a/crates/nu-command/src/dataframe/series/string/contains.rs b/crates/nu-cmd-dataframe/src/dataframe/series/string/contains.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/string/contains.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/string/contains.rs diff --git a/crates/nu-command/src/dataframe/series/string/mod.rs b/crates/nu-cmd-dataframe/src/dataframe/series/string/mod.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/string/mod.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/string/mod.rs diff --git a/crates/nu-command/src/dataframe/series/string/replace.rs b/crates/nu-cmd-dataframe/src/dataframe/series/string/replace.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/string/replace.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/string/replace.rs diff --git a/crates/nu-command/src/dataframe/series/string/replace_all.rs b/crates/nu-cmd-dataframe/src/dataframe/series/string/replace_all.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/string/replace_all.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/string/replace_all.rs diff --git a/crates/nu-command/src/dataframe/series/string/str_lengths.rs b/crates/nu-cmd-dataframe/src/dataframe/series/string/str_lengths.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/string/str_lengths.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/string/str_lengths.rs diff --git a/crates/nu-command/src/dataframe/series/string/str_slice.rs b/crates/nu-cmd-dataframe/src/dataframe/series/string/str_slice.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/string/str_slice.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/string/str_slice.rs diff --git a/crates/nu-command/src/dataframe/series/string/strftime.rs b/crates/nu-cmd-dataframe/src/dataframe/series/string/strftime.rs similarity index 98% rename from crates/nu-command/src/dataframe/series/string/strftime.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/string/strftime.rs index ebb5eeae4..eeece66c5 100644 --- a/crates/nu-command/src/dataframe/series/string/strftime.rs +++ b/crates/nu-cmd-dataframe/src/dataframe/series/string/strftime.rs @@ -97,12 +97,11 @@ fn command( .map(|df| PipelineData::Value(NuDataFrame::into_value(df, call.head), None)) } -#[cfg(test)] +#[cfg(explore_refactor_IntoDatetime)] mod test { use super::super::super::super::super::IntoDatetime; use super::super::super::super::test_dataframe::test_dataframe; use super::*; - #[test] fn test_examples() { test_dataframe(vec![Box::new(StrFTime {}), Box::new(IntoDatetime {})]) diff --git a/crates/nu-command/src/dataframe/series/string/to_lowercase.rs b/crates/nu-cmd-dataframe/src/dataframe/series/string/to_lowercase.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/string/to_lowercase.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/string/to_lowercase.rs diff --git a/crates/nu-command/src/dataframe/series/string/to_uppercase.rs b/crates/nu-cmd-dataframe/src/dataframe/series/string/to_uppercase.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/string/to_uppercase.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/string/to_uppercase.rs diff --git a/crates/nu-command/src/dataframe/series/unique.rs b/crates/nu-cmd-dataframe/src/dataframe/series/unique.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/unique.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/unique.rs diff --git a/crates/nu-command/src/dataframe/series/value_counts.rs b/crates/nu-cmd-dataframe/src/dataframe/series/value_counts.rs similarity index 100% rename from crates/nu-command/src/dataframe/series/value_counts.rs rename to crates/nu-cmd-dataframe/src/dataframe/series/value_counts.rs diff --git a/crates/nu-command/src/dataframe/test_dataframe.rs b/crates/nu-cmd-dataframe/src/dataframe/test_dataframe.rs similarity index 100% rename from crates/nu-command/src/dataframe/test_dataframe.rs rename to crates/nu-cmd-dataframe/src/dataframe/test_dataframe.rs diff --git a/crates/nu-command/src/dataframe/utils.rs b/crates/nu-cmd-dataframe/src/dataframe/utils.rs similarity index 100% rename from crates/nu-command/src/dataframe/utils.rs rename to crates/nu-cmd-dataframe/src/dataframe/utils.rs diff --git a/crates/nu-command/src/dataframe/values/mod.rs b/crates/nu-cmd-dataframe/src/dataframe/values/mod.rs similarity index 100% rename from crates/nu-command/src/dataframe/values/mod.rs rename to crates/nu-cmd-dataframe/src/dataframe/values/mod.rs diff --git a/crates/nu-command/src/dataframe/values/nu_dataframe/between_values.rs b/crates/nu-cmd-dataframe/src/dataframe/values/nu_dataframe/between_values.rs similarity index 100% rename from crates/nu-command/src/dataframe/values/nu_dataframe/between_values.rs rename to crates/nu-cmd-dataframe/src/dataframe/values/nu_dataframe/between_values.rs diff --git a/crates/nu-command/src/dataframe/values/nu_dataframe/conversion.rs b/crates/nu-cmd-dataframe/src/dataframe/values/nu_dataframe/conversion.rs similarity index 100% rename from crates/nu-command/src/dataframe/values/nu_dataframe/conversion.rs rename to crates/nu-cmd-dataframe/src/dataframe/values/nu_dataframe/conversion.rs diff --git a/crates/nu-command/src/dataframe/values/nu_dataframe/custom_value.rs b/crates/nu-cmd-dataframe/src/dataframe/values/nu_dataframe/custom_value.rs similarity index 100% rename from crates/nu-command/src/dataframe/values/nu_dataframe/custom_value.rs rename to crates/nu-cmd-dataframe/src/dataframe/values/nu_dataframe/custom_value.rs diff --git a/crates/nu-command/src/dataframe/values/nu_dataframe/mod.rs b/crates/nu-cmd-dataframe/src/dataframe/values/nu_dataframe/mod.rs similarity index 100% rename from crates/nu-command/src/dataframe/values/nu_dataframe/mod.rs rename to crates/nu-cmd-dataframe/src/dataframe/values/nu_dataframe/mod.rs diff --git a/crates/nu-command/src/dataframe/values/nu_dataframe/operations.rs b/crates/nu-cmd-dataframe/src/dataframe/values/nu_dataframe/operations.rs similarity index 100% rename from crates/nu-command/src/dataframe/values/nu_dataframe/operations.rs rename to crates/nu-cmd-dataframe/src/dataframe/values/nu_dataframe/operations.rs diff --git a/crates/nu-command/src/dataframe/values/nu_expression/custom_value.rs b/crates/nu-cmd-dataframe/src/dataframe/values/nu_expression/custom_value.rs similarity index 100% rename from crates/nu-command/src/dataframe/values/nu_expression/custom_value.rs rename to crates/nu-cmd-dataframe/src/dataframe/values/nu_expression/custom_value.rs diff --git a/crates/nu-command/src/dataframe/values/nu_expression/mod.rs b/crates/nu-cmd-dataframe/src/dataframe/values/nu_expression/mod.rs similarity index 100% rename from crates/nu-command/src/dataframe/values/nu_expression/mod.rs rename to crates/nu-cmd-dataframe/src/dataframe/values/nu_expression/mod.rs diff --git a/crates/nu-command/src/dataframe/values/nu_lazyframe/custom_value.rs b/crates/nu-cmd-dataframe/src/dataframe/values/nu_lazyframe/custom_value.rs similarity index 100% rename from crates/nu-command/src/dataframe/values/nu_lazyframe/custom_value.rs rename to crates/nu-cmd-dataframe/src/dataframe/values/nu_lazyframe/custom_value.rs diff --git a/crates/nu-command/src/dataframe/values/nu_lazyframe/mod.rs b/crates/nu-cmd-dataframe/src/dataframe/values/nu_lazyframe/mod.rs similarity index 100% rename from crates/nu-command/src/dataframe/values/nu_lazyframe/mod.rs rename to crates/nu-cmd-dataframe/src/dataframe/values/nu_lazyframe/mod.rs diff --git a/crates/nu-command/src/dataframe/values/nu_lazygroupby/custom_value.rs b/crates/nu-cmd-dataframe/src/dataframe/values/nu_lazygroupby/custom_value.rs similarity index 100% rename from crates/nu-command/src/dataframe/values/nu_lazygroupby/custom_value.rs rename to crates/nu-cmd-dataframe/src/dataframe/values/nu_lazygroupby/custom_value.rs diff --git a/crates/nu-command/src/dataframe/values/nu_lazygroupby/mod.rs b/crates/nu-cmd-dataframe/src/dataframe/values/nu_lazygroupby/mod.rs similarity index 100% rename from crates/nu-command/src/dataframe/values/nu_lazygroupby/mod.rs rename to crates/nu-cmd-dataframe/src/dataframe/values/nu_lazygroupby/mod.rs diff --git a/crates/nu-command/src/dataframe/values/nu_when/custom_value.rs b/crates/nu-cmd-dataframe/src/dataframe/values/nu_when/custom_value.rs similarity index 100% rename from crates/nu-command/src/dataframe/values/nu_when/custom_value.rs rename to crates/nu-cmd-dataframe/src/dataframe/values/nu_when/custom_value.rs diff --git a/crates/nu-command/src/dataframe/values/nu_when/mod.rs b/crates/nu-cmd-dataframe/src/dataframe/values/nu_when/mod.rs similarity index 100% rename from crates/nu-command/src/dataframe/values/nu_when/mod.rs rename to crates/nu-cmd-dataframe/src/dataframe/values/nu_when/mod.rs diff --git a/crates/nu-command/src/dataframe/values/utils.rs b/crates/nu-cmd-dataframe/src/dataframe/values/utils.rs similarity index 100% rename from crates/nu-command/src/dataframe/values/utils.rs rename to crates/nu-cmd-dataframe/src/dataframe/values/utils.rs diff --git a/crates/nu-cmd-dataframe/src/lib.rs b/crates/nu-cmd-dataframe/src/lib.rs new file mode 100644 index 000000000..f84027aca --- /dev/null +++ b/crates/nu-cmd-dataframe/src/lib.rs @@ -0,0 +1,2 @@ +pub mod dataframe; +pub use dataframe::*; diff --git a/crates/nu-command/Cargo.toml b/crates/nu-command/Cargo.toml index df42492b9..e236bcec8 100644 --- a/crates/nu-command/Cargo.toml +++ b/crates/nu-command/Cargo.toml @@ -14,6 +14,7 @@ bench = false [dependencies] nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.80.1" } +nu-cmd-dataframe = { path = "../nu-cmd-dataframe", version = "0.80.1", optional = true } nu-color-config = { path = "../nu-color-config", version = "0.80.1" } nu-engine = { path = "../nu-engine", version = "0.80.1" } nu-explore = { path = "../nu-explore", version = "0.80.1" } @@ -110,43 +111,12 @@ users = "0.11.0" optional = true version = "3.0.1" -[dependencies.polars] -features = [ - "arg_where", - "checked_arithmetic", - "concat_str", - "cross_join", - "csv", - "cum_agg", - "default", - "dtype-categorical", - "dtype-datetime", - "dtype-struct", - "dynamic_groupby", - "ipc", - "is_in", - "json", - "lazy", - "object", - "parquet", - "random", - "rolling_window", - "rows", - "serde", - "serde-lazy", - "strings", - "strings", - "to_dummies", -] -optional = true -version = "0.29.0" - [target.'cfg(windows)'.dependencies.windows] features = ["Win32_Foundation", "Win32_Storage_FileSystem", "Win32_System_SystemServices"] version = "0.48.0" [features] -dataframe = ["num", "polars", "sqlparser"] +dataframe = ["dep:nu-cmd-dataframe"] plugin = ["nu-parser/plugin"] sqlite = [ "rusqlite", diff --git a/crates/nu-command/src/default_context.rs b/crates/nu-command/src/default_context.rs index da9d56bce..d7b19afb5 100644 --- a/crates/nu-command/src/default_context.rs +++ b/crates/nu-command/src/default_context.rs @@ -1,6 +1,8 @@ use nu_protocol::engine::{EngineState, StateWorkingSet}; use crate::*; +#[cfg(feature = "dataframe")] +use nu_cmd_dataframe::*; pub fn create_default_context() -> EngineState { let mut engine_state = nu_cmd_lang::create_default_context(); diff --git a/crates/nu-command/src/lib.rs b/crates/nu-command/src/lib.rs index c0c2894b2..da423ee67 100644 --- a/crates/nu-command/src/lib.rs +++ b/crates/nu-command/src/lib.rs @@ -61,12 +61,6 @@ pub use system::*; pub use util::*; pub use viewers::*; -#[cfg(feature = "dataframe")] -mod dataframe; - -#[cfg(feature = "dataframe")] -pub use dataframe::*; - #[cfg(feature = "sqlite")] mod database;