From 46b8d1b0415fde113aefb26d2570b9652366e799 Mon Sep 17 00:00:00 2001 From: andres Date: Wed, 9 Oct 2024 14:10:37 -0500 Subject: [PATCH 01/10] fix: Keeps Enum order when converting to R --- src/rust/src/conversion_s_to_r.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/rust/src/conversion_s_to_r.rs b/src/rust/src/conversion_s_to_r.rs index 2963b5b91..e32885899 100644 --- a/src/rust/src/conversion_s_to_r.rs +++ b/src/rust/src/conversion_s_to_r.rs @@ -110,9 +110,11 @@ pub fn pl_series_to_list( .set_class(["rpolars_raw_list", "list"]) .expect("this class label is always valid") }), - Enum(_, _) => s - .categorical() - .map(|ca| extendr_api::call!("factor", ca.iter_str().collect_robj()).unwrap()), + Enum(_, _) => s.categorical().map(|ca| { + let levels = ca.unique().unwrap().iter_str().collect_robj(); + let values = ca.iter_str().collect_robj(); + extendr_api::call!("factor", values, levels).unwrap() + }), Categorical(_, _) => s .categorical() .map(|ca| extendr_api::call!("factor", ca.iter_str().collect_robj()).unwrap()), From 94a860931a27aa3c0f099315e92c5ffec6c7d553 Mon Sep 17 00:00:00 2001 From: andres Date: Wed, 9 Oct 2024 15:51:22 -0500 Subject: [PATCH 02/10] chore: Adds test to validate factor enum consistency --- tests/testthat/test-datatype.R | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/testthat/test-datatype.R b/tests/testthat/test-datatype.R index 3066ce4f2..bf2e01e00 100644 --- a/tests/testthat/test-datatype.R +++ b/tests/testthat/test-datatype.R @@ -224,12 +224,18 @@ test_that("contains_* functions for datatype work", { }) test_that("Enum", { - expect_identical( - as_polars_series(c("z", "z", "k", "a"))$ - cast(pl$Enum(c("z", "k", "a")))$ - to_r(), - factor(c("z", "z", "k", "a")) - ) + # Generate 100 random data frames with random + # orders for levels. They should always match + for (i in 1:100) { + expected_levels = sample(letters, length(letters)) + expected_values = sample(letters, length(letters)) + expect_identical( + as_polars_series(expected_values)$ + cast(pl$Enum(expected_levels))$ + to_r(), + factor(expected_values, levels = expected_levels) + ) + } expect_grepl_error(pl$Enum(), "missing") expect_grepl_error(pl$Enum(1), "invalid series dtype") From 53c8a8d3ec91f1817490813cee40ab4bd20a533e Mon Sep 17 00:00:00 2001 From: andres Date: Thu, 17 Oct 2024 18:14:46 -0500 Subject: [PATCH 03/10] chore: Adds property testing to enum conversions --- DESCRIPTION | 3 +- tests/testthat/_snaps/dataframe.md | 583 ++++++++++++++++------------- tests/testthat/test-datatype.R | 23 +- 3 files changed, 332 insertions(+), 277 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4b697fa11..7368f5fbc 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -35,6 +35,7 @@ Suggests: nanoarrow (>= 0.6.0), nycflights13, patrick, + quickcheck, pillar, rlang, rmarkdown, @@ -116,7 +117,7 @@ Collate: 'sql.R' 'vctrs.R' 'zzz.R' -Config/rextendr/version: 0.3.1 +Config/rextendr/version: 0.3.1.9000 VignetteBuilder: knitr Config/polars/LibVersion: 0.43.0 Config/polars/RustToolchainVersion: nightly-2024-09-19 diff --git a/tests/testthat/_snaps/dataframe.md b/tests/testthat/_snaps/dataframe.md index 2b207626e..a2d9ac9f5 100644 --- a/tests/testthat/_snaps/dataframe.md +++ b/tests/testthat/_snaps/dataframe.md @@ -4,17 +4,18 @@ df Output shape: (5, 6) - ┌─────────┬──────┬─────┬────────────┬──────────────┬──────────────┐ - │ newname ┆ a ┆ b ┆ new_column ┆ named_vector ┆ new_column_1 │ - │ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │ - │ f64 ┆ f64 ┆ str ┆ f64 ┆ f64 ┆ f64 │ - ╞═════════╪══════╪═════╪════════════╪══════════════╪══════════════╡ - │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ - │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ - │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ - │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ - │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ - └─────────┴──────┴─────┴────────────┴──────────────┴──────────────┘ + ┌─────────┬──────┬─────┬─────────┬────────┬────────┐ + │ newname ┆ a ┆ b ┆ new_col ┆ named_ ┆ new_co │ + │ --- ┆ --- ┆ --- ┆ umn ┆ vector ┆ lumn_1 │ + │ f64 ┆ f64 ┆ str ┆ --- ┆ --- ┆ --- │ + │ ┆ ┆ ┆ f64 ┆ f64 ┆ f64 │ + ╞═════════╪══════╪═════╪═════════╪════════╪════════╡ + │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ + │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ + │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ + │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ + │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ + └─────────┴──────┴─────┴─────────┴────────┴────────┘ # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_CELL_ALIGNMENT, .value=RIGHT @@ -22,34 +23,36 @@ df Output shape: (5, 6) - ┌─────────┬──────┬─────┬────────────┬──────────────┬──────────────┐ - │ newname ┆ a ┆ b ┆ new_column ┆ named_vector ┆ new_column_1 │ - │ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │ - │ f64 ┆ f64 ┆ str ┆ f64 ┆ f64 ┆ f64 │ - ╞═════════╪══════╪═════╪════════════╪══════════════╪══════════════╡ - │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ - │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ - │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ - │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ - │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ - └─────────┴──────┴─────┴────────────┴──────────────┴──────────────┘ + ┌─────────┬──────┬─────┬─────────┬────────┬────────┐ + │ newname ┆ a ┆ b ┆ new_col ┆ named_ ┆ new_co │ + │ --- ┆ --- ┆ --- ┆ umn ┆ vector ┆ lumn_1 │ + │ f64 ┆ f64 ┆ str ┆ --- ┆ --- ┆ --- │ + │ ┆ ┆ ┆ f64 ┆ f64 ┆ f64 │ + ╞═════════╪══════╪═════╪═════════╪════════╪════════╡ + │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ + │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ + │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ + │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ + │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ + └─────────┴──────┴─────┴─────────┴────────┴────────┘ # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_DATAFRAME_SHAPE_BELOW, .value=1 Code df Output - ┌─────────┬──────┬─────┬────────────┬──────────────┬──────────────┐ - │ newname ┆ a ┆ b ┆ new_column ┆ named_vector ┆ new_column_1 │ - │ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │ - │ f64 ┆ f64 ┆ str ┆ f64 ┆ f64 ┆ f64 │ - ╞═════════╪══════╪═════╪════════════╪══════════════╪══════════════╡ - │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ - │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ - │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ - │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ - │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ - └─────────┴──────┴─────┴────────────┴──────────────┴──────────────┘ + ┌─────────┬──────┬─────┬─────────┬────────┬────────┐ + │ newname ┆ a ┆ b ┆ new_col ┆ named_ ┆ new_co │ + │ --- ┆ --- ┆ --- ┆ umn ┆ vector ┆ lumn_1 │ + │ f64 ┆ f64 ┆ str ┆ --- ┆ --- ┆ --- │ + │ ┆ ┆ ┆ f64 ┆ f64 ┆ f64 │ + ╞═════════╪══════╪═════╪═════════╪════════╪════════╡ + │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ + │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ + │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ + │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ + │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ + └─────────┴──────┴─────┴─────────┴────────┴────────┘ shape: (5, 6) # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=ASCII_FULL @@ -58,21 +61,22 @@ df Output shape: (5, 6) - +---------+------+-----+------------+--------------+--------------+ - | newname | a | b | new_column | named_vector | new_column_1 | - | --- | --- | --- | --- | --- | --- | - | f64 | f64 | str | f64 | f64 | f64 | - +=================================================================+ - | 1.0 | 5.0 | a | 5.0 | 15.0 | 5.0 | - |---------+------+-----+------------+--------------+--------------| - | 2.0 | 10.0 | b | 4.0 | 14.0 | 4.0 | - |---------+------+-----+------------+--------------+--------------| - | 3.0 | 15.0 | c | 3.0 | 13.0 | 3.0 | - |---------+------+-----+------------+--------------+--------------| - | 4.0 | 20.0 | d | 2.0 | 12.0 | 2.0 | - |---------+------+-----+------------+--------------+--------------| - | 5.0 | 25.0 | e | 1.0 | 11.0 | 0.0 | - +---------+------+-----+------------+--------------+--------------+ + +---------+------+-----+---------+--------+--------+ + | newname | a | b | new_col | named_ | new_co | + | --- | --- | --- | umn | vector | lumn_1 | + | f64 | f64 | str | --- | --- | --- | + | | | | f64 | f64 | f64 | + +==================================================+ + | 1.0 | 5.0 | a | 5.0 | 15.0 | 5.0 | + |---------+------+-----+---------+--------+--------| + | 2.0 | 10.0 | b | 4.0 | 14.0 | 4.0 | + |---------+------+-----+---------+--------+--------| + | 3.0 | 15.0 | c | 3.0 | 13.0 | 3.0 | + |---------+------+-----+---------+--------+--------| + | 4.0 | 20.0 | d | 2.0 | 12.0 | 2.0 | + |---------+------+-----+---------+--------+--------| + | 5.0 | 25.0 | e | 1.0 | 11.0 | 0.0 | + +---------+------+-----+---------+--------+--------+ # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=ASCII_FULL_CONDENSED @@ -80,17 +84,18 @@ df Output shape: (5, 6) - +---------+------+-----+------------+--------------+--------------+ - | newname | a | b | new_column | named_vector | new_column_1 | - | --- | --- | --- | --- | --- | --- | - | f64 | f64 | str | f64 | f64 | f64 | - +=================================================================+ - | 1.0 | 5.0 | a | 5.0 | 15.0 | 5.0 | - | 2.0 | 10.0 | b | 4.0 | 14.0 | 4.0 | - | 3.0 | 15.0 | c | 3.0 | 13.0 | 3.0 | - | 4.0 | 20.0 | d | 2.0 | 12.0 | 2.0 | - | 5.0 | 25.0 | e | 1.0 | 11.0 | 0.0 | - +---------+------+-----+------------+--------------+--------------+ + +---------+------+-----+---------+--------+--------+ + | newname | a | b | new_col | named_ | new_co | + | --- | --- | --- | umn | vector | lumn_1 | + | f64 | f64 | str | --- | --- | --- | + | | | | f64 | f64 | f64 | + +==================================================+ + | 1.0 | 5.0 | a | 5.0 | 15.0 | 5.0 | + | 2.0 | 10.0 | b | 4.0 | 14.0 | 4.0 | + | 3.0 | 15.0 | c | 3.0 | 13.0 | 3.0 | + | 4.0 | 20.0 | d | 2.0 | 12.0 | 2.0 | + | 5.0 | 25.0 | e | 1.0 | 11.0 | 0.0 | + +---------+------+-----+---------+--------+--------+ # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=ASCII_NO_BORDERS @@ -98,19 +103,20 @@ df Output shape: (5, 6) - newname | a | b | new_column | named_vector | new_column_1 - --- | --- | --- | --- | --- | --- - f64 | f64 | str | f64 | f64 | f64 - ================================================================= - 1.0 | 5.0 | a | 5.0 | 15.0 | 5.0 - ---------+------+-----+------------+--------------+-------------- - 2.0 | 10.0 | b | 4.0 | 14.0 | 4.0 - ---------+------+-----+------------+--------------+-------------- - 3.0 | 15.0 | c | 3.0 | 13.0 | 3.0 - ---------+------+-----+------------+--------------+-------------- - 4.0 | 20.0 | d | 2.0 | 12.0 | 2.0 - ---------+------+-----+------------+--------------+-------------- - 5.0 | 25.0 | e | 1.0 | 11.0 | 0.0 + newname | a | b | new_col | named_v | new_col + --- | --- | --- | umn | ector | umn_1 + f64 | f64 | str | --- | --- | --- + | | | f64 | f64 | f64 + ==================================================== + 1.0 | 5.0 | a | 5.0 | 15.0 | 5.0 + ---------+------+-----+---------+---------+--------- + 2.0 | 10.0 | b | 4.0 | 14.0 | 4.0 + ---------+------+-----+---------+---------+--------- + 3.0 | 15.0 | c | 3.0 | 13.0 | 3.0 + ---------+------+-----+---------+---------+--------- + 4.0 | 20.0 | d | 2.0 | 12.0 | 2.0 + ---------+------+-----+---------+---------+--------- + 5.0 | 25.0 | e | 1.0 | 11.0 | 0.0 # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=ASCII_BORDERS_ONLY @@ -118,21 +124,22 @@ df Output shape: (5, 6) - +-----------------------------------------------------------------+ - | newname a b new_column named_vector new_column_1 | - | --- --- --- --- --- --- | - | f64 f64 str f64 f64 f64 | - +=================================================================+ - | 1.0 5.0 a 5.0 15.0 5.0 | - | | - | 2.0 10.0 b 4.0 14.0 4.0 | - | | - | 3.0 15.0 c 3.0 13.0 3.0 | - | | - | 4.0 20.0 d 2.0 12.0 2.0 | - | | - | 5.0 25.0 e 1.0 11.0 0.0 | - +-----------------------------------------------------------------+ + +--------------------------------------------------+ + | newname a b new_col named_ new_co | + | --- --- --- umn vector lumn_1 | + | f64 f64 str --- --- --- | + | f64 f64 f64 | + +==================================================+ + | 1.0 5.0 a 5.0 15.0 5.0 | + | | + | 2.0 10.0 b 4.0 14.0 4.0 | + | | + | 3.0 15.0 c 3.0 13.0 3.0 | + | | + | 4.0 20.0 d 2.0 12.0 2.0 | + | | + | 5.0 25.0 e 1.0 11.0 0.0 | + +--------------------------------------------------+ # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=ASCII_BORDERS_ONLY_CONDENSED @@ -140,17 +147,18 @@ df Output shape: (5, 6) - +-----------------------------------------------------------------+ - | newname a b new_column named_vector new_column_1 | - | --- --- --- --- --- --- | - | f64 f64 str f64 f64 f64 | - +=================================================================+ - | 1.0 5.0 a 5.0 15.0 5.0 | - | 2.0 10.0 b 4.0 14.0 4.0 | - | 3.0 15.0 c 3.0 13.0 3.0 | - | 4.0 20.0 d 2.0 12.0 2.0 | - | 5.0 25.0 e 1.0 11.0 0.0 | - +-----------------------------------------------------------------+ + +--------------------------------------------------+ + | newname a b new_col named_ new_co | + | --- --- --- umn vector lumn_1 | + | f64 f64 str --- --- --- | + | f64 f64 f64 | + +==================================================+ + | 1.0 5.0 a 5.0 15.0 5.0 | + | 2.0 10.0 b 4.0 14.0 4.0 | + | 3.0 15.0 c 3.0 13.0 3.0 | + | 4.0 20.0 d 2.0 12.0 2.0 | + | 5.0 25.0 e 1.0 11.0 0.0 | + +--------------------------------------------------+ # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=ASCII_HORIZONTAL_ONLY @@ -158,21 +166,22 @@ df Output shape: (5, 6) - ----------------------------------------------------------------- - newname a b new_column named_vector new_column_1 - --- --- --- --- --- --- - f64 f64 str f64 f64 f64 - ================================================================= - 1.0 5.0 a 5.0 15.0 5.0 - ----------------------------------------------------------------- - 2.0 10.0 b 4.0 14.0 4.0 - ----------------------------------------------------------------- - 3.0 15.0 c 3.0 13.0 3.0 - ----------------------------------------------------------------- - 4.0 20.0 d 2.0 12.0 2.0 - ----------------------------------------------------------------- - 5.0 25.0 e 1.0 11.0 0.0 - ----------------------------------------------------------------- + ---------------------------------------------------- + newname a b new_col named_v new_col + --- --- --- umn ector umn_1 + f64 f64 str --- --- --- + f64 f64 f64 + ==================================================== + 1.0 5.0 a 5.0 15.0 5.0 + ---------------------------------------------------- + 2.0 10.0 b 4.0 14.0 4.0 + ---------------------------------------------------- + 3.0 15.0 c 3.0 13.0 3.0 + ---------------------------------------------------- + 4.0 20.0 d 2.0 12.0 2.0 + ---------------------------------------------------- + 5.0 25.0 e 1.0 11.0 0.0 + ---------------------------------------------------- # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=ASCII_MARKDOWN @@ -180,15 +189,16 @@ df Output shape: (5, 6) - | newname | a | b | new_column | named_vector | new_column_1 | - | --- | --- | --- | --- | --- | --- | - | f64 | f64 | str | f64 | f64 | f64 | - |---------|------|-----|------------|--------------|--------------| - | 1.0 | 5.0 | a | 5.0 | 15.0 | 5.0 | - | 2.0 | 10.0 | b | 4.0 | 14.0 | 4.0 | - | 3.0 | 15.0 | c | 3.0 | 13.0 | 3.0 | - | 4.0 | 20.0 | d | 2.0 | 12.0 | 2.0 | - | 5.0 | 25.0 | e | 1.0 | 11.0 | 0.0 | + | newname | a | b | new_col | named_ | new_co | + | --- | --- | --- | umn | vector | lumn_1 | + | f64 | f64 | str | --- | --- | --- | + | | | | f64 | f64 | f64 | + |---------|------|-----|---------|--------|--------| + | 1.0 | 5.0 | a | 5.0 | 15.0 | 5.0 | + | 2.0 | 10.0 | b | 4.0 | 14.0 | 4.0 | + | 3.0 | 15.0 | c | 3.0 | 13.0 | 3.0 | + | 4.0 | 20.0 | d | 2.0 | 12.0 | 2.0 | + | 5.0 | 25.0 | e | 1.0 | 11.0 | 0.0 | # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=UTF8_FULL @@ -196,21 +206,22 @@ df Output shape: (5, 6) - ┌─────────┬──────┬─────┬────────────┬──────────────┬──────────────┐ - │ newname ┆ a ┆ b ┆ new_column ┆ named_vector ┆ new_column_1 │ - │ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │ - │ f64 ┆ f64 ┆ str ┆ f64 ┆ f64 ┆ f64 │ - ╞═════════╪══════╪═════╪════════════╪══════════════╪══════════════╡ - │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ - ├╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ - │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ - ├╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ - │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ - ├╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ - │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ - ├╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ - │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ - └─────────┴──────┴─────┴────────────┴──────────────┴──────────────┘ + ┌─────────┬──────┬─────┬─────────┬────────┬────────┐ + │ newname ┆ a ┆ b ┆ new_col ┆ named_ ┆ new_co │ + │ --- ┆ --- ┆ --- ┆ umn ┆ vector ┆ lumn_1 │ + │ f64 ┆ f64 ┆ str ┆ --- ┆ --- ┆ --- │ + │ ┆ ┆ ┆ f64 ┆ f64 ┆ f64 │ + ╞═════════╪══════╪═════╪═════════╪════════╪════════╡ + │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ + ├╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤ + │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ + ├╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤ + │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ + ├╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤ + │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ + ├╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤ + │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ + └─────────┴──────┴─────┴─────────┴────────┴────────┘ # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=UTF8_FULL_CONDENSED @@ -218,17 +229,18 @@ df Output shape: (5, 6) - ┌─────────┬──────┬─────┬────────────┬──────────────┬──────────────┐ - │ newname ┆ a ┆ b ┆ new_column ┆ named_vector ┆ new_column_1 │ - │ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │ - │ f64 ┆ f64 ┆ str ┆ f64 ┆ f64 ┆ f64 │ - ╞═════════╪══════╪═════╪════════════╪══════════════╪══════════════╡ - │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ - │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ - │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ - │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ - │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ - └─────────┴──────┴─────┴────────────┴──────────────┴──────────────┘ + ┌─────────┬──────┬─────┬─────────┬────────┬────────┐ + │ newname ┆ a ┆ b ┆ new_col ┆ named_ ┆ new_co │ + │ --- ┆ --- ┆ --- ┆ umn ┆ vector ┆ lumn_1 │ + │ f64 ┆ f64 ┆ str ┆ --- ┆ --- ┆ --- │ + │ ┆ ┆ ┆ f64 ┆ f64 ┆ f64 │ + ╞═════════╪══════╪═════╪═════════╪════════╪════════╡ + │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ + │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ + │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ + │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ + │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ + └─────────┴──────┴─────┴─────────┴────────┴────────┘ # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=UTF8_NO_BORDERS @@ -236,19 +248,20 @@ df Output shape: (5, 6) - newname ┆ a ┆ b ┆ new_column ┆ named_vector ┆ new_column_1 - --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- - f64 ┆ f64 ┆ str ┆ f64 ┆ f64 ┆ f64 - ═════════╪══════╪═════╪════════════╪══════════════╪══════════════ - 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 - ╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌ - 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 - ╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌ - 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 - ╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌ - 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 - ╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌ - 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 + newname ┆ a ┆ b ┆ new_col ┆ named_v ┆ new_col + --- ┆ --- ┆ --- ┆ umn ┆ ector ┆ umn_1 + f64 ┆ f64 ┆ str ┆ --- ┆ --- ┆ --- + ┆ ┆ ┆ f64 ┆ f64 ┆ f64 + ═════════╪══════╪═════╪═════════╪═════════╪═════════ + 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 + ╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌ + 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 + ╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌ + 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 + ╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌ + 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 + ╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌ + 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=UTF8_BORDERS_ONLY @@ -256,17 +269,18 @@ df Output shape: (5, 6) - ┌─────────────────────────────────────────────────────────────────┐ - │ newname a b new_column named_vector new_column_1 │ - │ --- --- --- --- --- --- │ - │ f64 f64 str f64 f64 f64 │ - ╞═════════════════════════════════════════════════════════════════╡ - │ 1.0 5.0 a 5.0 15.0 5.0 │ - │ 2.0 10.0 b 4.0 14.0 4.0 │ - │ 3.0 15.0 c 3.0 13.0 3.0 │ - │ 4.0 20.0 d 2.0 12.0 2.0 │ - │ 5.0 25.0 e 1.0 11.0 0.0 │ - └─────────────────────────────────────────────────────────────────┘ + ┌──────────────────────────────────────────────────┐ + │ newname a b new_col named_ new_co │ + │ --- --- --- umn vector lumn_1 │ + │ f64 f64 str --- --- --- │ + │ f64 f64 f64 │ + ╞══════════════════════════════════════════════════╡ + │ 1.0 5.0 a 5.0 15.0 5.0 │ + │ 2.0 10.0 b 4.0 14.0 4.0 │ + │ 3.0 15.0 c 3.0 13.0 3.0 │ + │ 4.0 20.0 d 2.0 12.0 2.0 │ + │ 5.0 25.0 e 1.0 11.0 0.0 │ + └──────────────────────────────────────────────────┘ # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=UTF8_HORIZONTAL_ONLY @@ -274,21 +288,22 @@ df Output shape: (5, 6) - ───────────────────────────────────────────────────────────────── - newname a b new_column named_vector new_column_1 - --- --- --- --- --- --- - f64 f64 str f64 f64 f64 - ═════════════════════════════════════════════════════════════════ - 1.0 5.0 a 5.0 15.0 5.0 - ───────────────────────────────────────────────────────────────── - 2.0 10.0 b 4.0 14.0 4.0 - ───────────────────────────────────────────────────────────────── - 3.0 15.0 c 3.0 13.0 3.0 - ───────────────────────────────────────────────────────────────── - 4.0 20.0 d 2.0 12.0 2.0 - ───────────────────────────────────────────────────────────────── - 5.0 25.0 e 1.0 11.0 0.0 - ───────────────────────────────────────────────────────────────── + ──────────────────────────────────────────────────── + newname a b new_col named_v new_col + --- --- --- umn ector umn_1 + f64 f64 str --- --- --- + f64 f64 f64 + ════════════════════════════════════════════════════ + 1.0 5.0 a 5.0 15.0 5.0 + ──────────────────────────────────────────────────── + 2.0 10.0 b 4.0 14.0 4.0 + ──────────────────────────────────────────────────── + 3.0 15.0 c 3.0 13.0 3.0 + ──────────────────────────────────────────────────── + 4.0 20.0 d 2.0 12.0 2.0 + ──────────────────────────────────────────────────── + 5.0 25.0 e 1.0 11.0 0.0 + ──────────────────────────────────────────────────── # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=NOTHING @@ -296,14 +311,15 @@ df Output shape: (5, 6) - newname a b new_column named_vector new_column_1 - --- --- --- --- --- --- - f64 f64 str f64 f64 f64 - 1.0 5.0 a 5.0 15.0 5.0 - 2.0 10.0 b 4.0 14.0 4.0 - 3.0 15.0 c 3.0 13.0 3.0 - 4.0 20.0 d 2.0 12.0 2.0 - 5.0 25.0 e 1.0 11.0 0.0 + newname a b new_colum named_vec new_colu + --- --- --- n tor mn_1 + f64 f64 str --- --- --- + f64 f64 f64 + 1.0 5.0 a 5.0 15.0 5.0 + 2.0 10.0 b 4.0 14.0 4.0 + 3.0 15.0 c 3.0 13.0 3.0 + 4.0 20.0 d 2.0 12.0 2.0 + 5.0 25.0 e 1.0 11.0 0.0 # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_HIDE_COLUMN_DATA_TYPES, .value=1 @@ -311,15 +327,16 @@ df Output shape: (5, 6) - ┌─────────┬──────┬───┬────────────┬──────────────┬──────────────┐ - │ newname ┆ a ┆ b ┆ new_column ┆ named_vector ┆ new_column_1 │ - ╞═════════╪══════╪═══╪════════════╪══════════════╪══════════════╡ - │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ - │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ - │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ - │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ - │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ - └─────────┴──────┴───┴────────────┴──────────────┴──────────────┘ + ┌─────────┬──────┬───┬─────────┬─────────┬─────────┐ + │ newname ┆ a ┆ b ┆ new_col ┆ named_v ┆ new_col │ + │ ┆ ┆ ┆ umn ┆ ector ┆ umn_1 │ + ╞═════════╪══════╪═══╪═════════╪═════════╪═════════╡ + │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ + │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ + │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ + │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ + │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ + └─────────┴──────┴───┴─────────┴─────────┴─────────┘ # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_HIDE_COLUMN_NAMES, .value=1 @@ -343,33 +360,35 @@ df Output shape: (5, 6) - ┌─────────┬──────┬─────┬────────────┬──────────────┬──────────────┐ - │ newname ┆ a ┆ b ┆ new_column ┆ named_vector ┆ new_column_1 │ - │ f64 ┆ f64 ┆ str ┆ f64 ┆ f64 ┆ f64 │ - ╞═════════╪══════╪═════╪════════════╪══════════════╪══════════════╡ - │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ - │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ - │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ - │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ - │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ - └─────────┴──────┴─────┴────────────┴──────────────┴──────────────┘ + ┌─────────┬──────┬─────┬─────────┬────────┬────────┐ + │ newname ┆ a ┆ b ┆ new_col ┆ named_ ┆ new_co │ + │ f64 ┆ f64 ┆ str ┆ umn ┆ vector ┆ lumn_1 │ + │ ┆ ┆ ┆ f64 ┆ f64 ┆ f64 │ + ╞═════════╪══════╪═════╪═════════╪════════╪════════╡ + │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ + │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ + │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ + │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ + │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ + └─────────┴──────┴─────┴─────────┴────────┴────────┘ # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_HIDE_DATAFRAME_SHAPE_INFORMATION, .value=1 Code df Output - ┌─────────┬──────┬─────┬────────────┬──────────────┬──────────────┐ - │ newname ┆ a ┆ b ┆ new_column ┆ named_vector ┆ new_column_1 │ - │ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │ - │ f64 ┆ f64 ┆ str ┆ f64 ┆ f64 ┆ f64 │ - ╞═════════╪══════╪═════╪════════════╪══════════════╪══════════════╡ - │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ - │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ - │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ - │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ - │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ - └─────────┴──────┴─────┴────────────┴──────────────┴──────────────┘ + ┌─────────┬──────┬─────┬─────────┬────────┬────────┐ + │ newname ┆ a ┆ b ┆ new_col ┆ named_ ┆ new_co │ + │ --- ┆ --- ┆ --- ┆ umn ┆ vector ┆ lumn_1 │ + │ f64 ┆ f64 ┆ str ┆ --- ┆ --- ┆ --- │ + │ ┆ ┆ ┆ f64 ┆ f64 ┆ f64 │ + ╞═════════╪══════╪═════╪═════════╪════════╪════════╡ + │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ + │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ + │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ + │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ + │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ + └─────────┴──────┴─────┴─────────┴────────┴────────┘ # DataFrame, mixed input, create and print .name=POLARS_FMT_MAX_ROWS, .value=2 @@ -377,15 +396,16 @@ df Output shape: (5, 6) - ┌─────────┬──────┬─────┬────────────┬──────────────┬──────────────┐ - │ newname ┆ a ┆ b ┆ new_column ┆ named_vector ┆ new_column_1 │ - │ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │ - │ f64 ┆ f64 ┆ str ┆ f64 ┆ f64 ┆ f64 │ - ╞═════════╪══════╪═════╪════════════╪══════════════╪══════════════╡ - │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ - │ … ┆ … ┆ … ┆ … ┆ … ┆ … │ - │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ - └─────────┴──────┴─────┴────────────┴──────────────┴──────────────┘ + ┌─────────┬──────┬─────┬─────────┬────────┬────────┐ + │ newname ┆ a ┆ b ┆ new_col ┆ named_ ┆ new_co │ + │ --- ┆ --- ┆ --- ┆ umn ┆ vector ┆ lumn_1 │ + │ f64 ┆ f64 ┆ str ┆ --- ┆ --- ┆ --- │ + │ ┆ ┆ ┆ f64 ┆ f64 ┆ f64 │ + ╞═════════╪══════╪═════╪═════════╪════════╪════════╡ + │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ + │ … ┆ … ┆ … ┆ … ┆ … ┆ … │ + │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ + └─────────┴──────┴─────┴─────────┴────────┴────────┘ # describe @@ -415,21 +435,38 @@ pl$DataFrame(mtcars)$describe() Output shape: (9, 12) - ┌────────────┬───────────┬──────────┬────────────┬───┬──────────┬──────────┬──────────┬────────┐ - │ statistic ┆ mpg ┆ cyl ┆ disp ┆ … ┆ vs ┆ am ┆ gear ┆ carb │ - │ --- ┆ --- ┆ --- ┆ --- ┆ ┆ --- ┆ --- ┆ --- ┆ --- │ - │ str ┆ f64 ┆ f64 ┆ f64 ┆ ┆ f64 ┆ f64 ┆ f64 ┆ f64 │ - ╞════════════╪═══════════╪══════════╪════════════╪═══╪══════════╪══════════╪══════════╪════════╡ - │ count ┆ 32.0 ┆ 32.0 ┆ 32.0 ┆ … ┆ 32.0 ┆ 32.0 ┆ 32.0 ┆ 32.0 │ - │ null_count ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ … ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 │ - │ mean ┆ 20.090625 ┆ 6.1875 ┆ 230.721875 ┆ … ┆ 0.4375 ┆ 0.40625 ┆ 3.6875 ┆ 2.8125 │ - │ std ┆ 6.026948 ┆ 1.785922 ┆ 123.938694 ┆ … ┆ 0.504016 ┆ 0.498991 ┆ 0.737804 ┆ 1.6152 │ - │ min ┆ 10.4 ┆ 4.0 ┆ 71.1 ┆ … ┆ 0.0 ┆ 0.0 ┆ 3.0 ┆ 1.0 │ - │ 25% ┆ 15.5 ┆ 4.0 ┆ 121.0 ┆ … ┆ 0.0 ┆ 0.0 ┆ 3.0 ┆ 2.0 │ - │ 50% ┆ 19.2 ┆ 6.0 ┆ 225.0 ┆ … ┆ 0.0 ┆ 0.0 ┆ 4.0 ┆ 2.0 │ - │ 75% ┆ 22.8 ┆ 8.0 ┆ 318.0 ┆ … ┆ 1.0 ┆ 1.0 ┆ 4.0 ┆ 4.0 │ - │ max ┆ 33.9 ┆ 8.0 ┆ 472.0 ┆ … ┆ 1.0 ┆ 1.0 ┆ 5.0 ┆ 8.0 │ - └────────────┴───────────┴──────────┴────────────┴───┴──────────┴──────────┴──────────┴────────┘ + ┌─────┬─────┬─────┬─────┬───┬─────┬─────┬─────┬─────┐ + │ sta ┆ mpg ┆ cyl ┆ dis ┆ … ┆ vs ┆ am ┆ gea ┆ car │ + │ tis ┆ --- ┆ --- ┆ p ┆ ┆ --- ┆ --- ┆ r ┆ b │ + │ tic ┆ f64 ┆ f64 ┆ --- ┆ ┆ f64 ┆ f64 ┆ --- ┆ --- │ + │ --- ┆ ┆ ┆ f64 ┆ ┆ ┆ ┆ f64 ┆ f64 │ + │ str ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ + ╞═════╪═════╪═════╪═════╪═══╪═════╪═════╪═════╪═════╡ + │ cou ┆ 32. ┆ 32. ┆ 32. ┆ … ┆ 32. ┆ 32. ┆ 32. ┆ 32. │ + │ nt ┆ 0 ┆ 0 ┆ 0 ┆ ┆ 0 ┆ 0 ┆ 0 ┆ 0 │ + │ nul ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ … ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 │ + │ l_c ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ + │ oun ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ + │ t ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ + │ mea ┆ 20. ┆ 6.1 ┆ 230 ┆ … ┆ 0.4 ┆ 0.4 ┆ 3.6 ┆ 2.8 │ + │ n ┆ 090 ┆ 875 ┆ .72 ┆ ┆ 375 ┆ 062 ┆ 875 ┆ 125 │ + │ ┆ 625 ┆ ┆ 187 ┆ ┆ ┆ 5 ┆ ┆ │ + │ ┆ ┆ ┆ 5 ┆ ┆ ┆ ┆ ┆ │ + │ std ┆ 6.0 ┆ 1.7 ┆ 123 ┆ … ┆ 0.5 ┆ 0.4 ┆ 0.7 ┆ 1.6 │ + │ ┆ 269 ┆ 859 ┆ .93 ┆ ┆ 040 ┆ 989 ┆ 378 ┆ 152 │ + │ ┆ 48 ┆ 22 ┆ 869 ┆ ┆ 16 ┆ 91 ┆ 04 ┆ │ + │ ┆ ┆ ┆ 4 ┆ ┆ ┆ ┆ ┆ │ + │ min ┆ 10. ┆ 4.0 ┆ 71. ┆ … ┆ 0.0 ┆ 0.0 ┆ 3.0 ┆ 1.0 │ + │ ┆ 4 ┆ ┆ 1 ┆ ┆ ┆ ┆ ┆ │ + │ 25% ┆ 15. ┆ 4.0 ┆ 121 ┆ … ┆ 0.0 ┆ 0.0 ┆ 3.0 ┆ 2.0 │ + │ ┆ 5 ┆ ┆ .0 ┆ ┆ ┆ ┆ ┆ │ + │ 50% ┆ 19. ┆ 6.0 ┆ 225 ┆ … ┆ 0.0 ┆ 0.0 ┆ 4.0 ┆ 2.0 │ + │ ┆ 2 ┆ ┆ .0 ┆ ┆ ┆ ┆ ┆ │ + │ 75% ┆ 22. ┆ 8.0 ┆ 318 ┆ … ┆ 1.0 ┆ 1.0 ┆ 4.0 ┆ 4.0 │ + │ ┆ 8 ┆ ┆ .0 ┆ ┆ ┆ ┆ ┆ │ + │ max ┆ 33. ┆ 8.0 ┆ 472 ┆ … ┆ 1.0 ┆ 1.0 ┆ 5.0 ┆ 8.0 │ + │ ┆ 9 ┆ ┆ .0 ┆ ┆ ┆ ┆ ┆ │ + └─────┴─────┴─────┴─────┴───┴─────┴─────┴─────┴─────┘ --- @@ -437,21 +474,39 @@ pl$DataFrame(mtcars)$describe(interpolation = "linear") Output shape: (9, 12) - ┌────────────┬───────────┬──────────┬────────────┬───┬──────────┬──────────┬──────────┬────────┐ - │ statistic ┆ mpg ┆ cyl ┆ disp ┆ … ┆ vs ┆ am ┆ gear ┆ carb │ - │ --- ┆ --- ┆ --- ┆ --- ┆ ┆ --- ┆ --- ┆ --- ┆ --- │ - │ str ┆ f64 ┆ f64 ┆ f64 ┆ ┆ f64 ┆ f64 ┆ f64 ┆ f64 │ - ╞════════════╪═══════════╪══════════╪════════════╪═══╪══════════╪══════════╪══════════╪════════╡ - │ count ┆ 32.0 ┆ 32.0 ┆ 32.0 ┆ … ┆ 32.0 ┆ 32.0 ┆ 32.0 ┆ 32.0 │ - │ null_count ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ … ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 │ - │ mean ┆ 20.090625 ┆ 6.1875 ┆ 230.721875 ┆ … ┆ 0.4375 ┆ 0.40625 ┆ 3.6875 ┆ 2.8125 │ - │ std ┆ 6.026948 ┆ 1.785922 ┆ 123.938694 ┆ … ┆ 0.504016 ┆ 0.498991 ┆ 0.737804 ┆ 1.6152 │ - │ min ┆ 10.4 ┆ 4.0 ┆ 71.1 ┆ … ┆ 0.0 ┆ 0.0 ┆ 3.0 ┆ 1.0 │ - │ 25% ┆ 15.425 ┆ 4.0 ┆ 120.825 ┆ … ┆ 0.0 ┆ 0.0 ┆ 3.0 ┆ 2.0 │ - │ 50% ┆ 19.2 ┆ 6.0 ┆ 196.3 ┆ … ┆ 0.0 ┆ 0.0 ┆ 4.0 ┆ 2.0 │ - │ 75% ┆ 22.8 ┆ 8.0 ┆ 326.0 ┆ … ┆ 1.0 ┆ 1.0 ┆ 4.0 ┆ 4.0 │ - │ max ┆ 33.9 ┆ 8.0 ┆ 472.0 ┆ … ┆ 1.0 ┆ 1.0 ┆ 5.0 ┆ 8.0 │ - └────────────┴───────────┴──────────┴────────────┴───┴──────────┴──────────┴──────────┴────────┘ + ┌─────┬─────┬─────┬─────┬───┬─────┬─────┬─────┬─────┐ + │ sta ┆ mpg ┆ cyl ┆ dis ┆ … ┆ vs ┆ am ┆ gea ┆ car │ + │ tis ┆ --- ┆ --- ┆ p ┆ ┆ --- ┆ --- ┆ r ┆ b │ + │ tic ┆ f64 ┆ f64 ┆ --- ┆ ┆ f64 ┆ f64 ┆ --- ┆ --- │ + │ --- ┆ ┆ ┆ f64 ┆ ┆ ┆ ┆ f64 ┆ f64 │ + │ str ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ + ╞═════╪═════╪═════╪═════╪═══╪═════╪═════╪═════╪═════╡ + │ cou ┆ 32. ┆ 32. ┆ 32. ┆ … ┆ 32. ┆ 32. ┆ 32. ┆ 32. │ + │ nt ┆ 0 ┆ 0 ┆ 0 ┆ ┆ 0 ┆ 0 ┆ 0 ┆ 0 │ + │ nul ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ … ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 │ + │ l_c ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ + │ oun ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ + │ t ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ + │ mea ┆ 20. ┆ 6.1 ┆ 230 ┆ … ┆ 0.4 ┆ 0.4 ┆ 3.6 ┆ 2.8 │ + │ n ┆ 090 ┆ 875 ┆ .72 ┆ ┆ 375 ┆ 062 ┆ 875 ┆ 125 │ + │ ┆ 625 ┆ ┆ 187 ┆ ┆ ┆ 5 ┆ ┆ │ + │ ┆ ┆ ┆ 5 ┆ ┆ ┆ ┆ ┆ │ + │ std ┆ 6.0 ┆ 1.7 ┆ 123 ┆ … ┆ 0.5 ┆ 0.4 ┆ 0.7 ┆ 1.6 │ + │ ┆ 269 ┆ 859 ┆ .93 ┆ ┆ 040 ┆ 989 ┆ 378 ┆ 152 │ + │ ┆ 48 ┆ 22 ┆ 869 ┆ ┆ 16 ┆ 91 ┆ 04 ┆ │ + │ ┆ ┆ ┆ 4 ┆ ┆ ┆ ┆ ┆ │ + │ min ┆ 10. ┆ 4.0 ┆ 71. ┆ … ┆ 0.0 ┆ 0.0 ┆ 3.0 ┆ 1.0 │ + │ ┆ 4 ┆ ┆ 1 ┆ ┆ ┆ ┆ ┆ │ + │ 25% ┆ 15. ┆ 4.0 ┆ 120 ┆ … ┆ 0.0 ┆ 0.0 ┆ 3.0 ┆ 2.0 │ + │ ┆ 425 ┆ ┆ .82 ┆ ┆ ┆ ┆ ┆ │ + │ ┆ ┆ ┆ 5 ┆ ┆ ┆ ┆ ┆ │ + │ 50% ┆ 19. ┆ 6.0 ┆ 196 ┆ … ┆ 0.0 ┆ 0.0 ┆ 4.0 ┆ 2.0 │ + │ ┆ 2 ┆ ┆ .3 ┆ ┆ ┆ ┆ ┆ │ + │ 75% ┆ 22. ┆ 8.0 ┆ 326 ┆ … ┆ 1.0 ┆ 1.0 ┆ 4.0 ┆ 4.0 │ + │ ┆ 8 ┆ ┆ .0 ┆ ┆ ┆ ┆ ┆ │ + │ max ┆ 33. ┆ 8.0 ┆ 472 ┆ … ┆ 1.0 ┆ 1.0 ┆ 5.0 ┆ 8.0 │ + │ ┆ 9 ┆ ┆ .0 ┆ ┆ ┆ ┆ ┆ │ + └─────┴─────┴─────┴─────┴───┴─────┴─────┴─────┴─────┘ --- diff --git a/tests/testthat/test-datatype.R b/tests/testthat/test-datatype.R index bf2e01e00..11aac3d15 100644 --- a/tests/testthat/test-datatype.R +++ b/tests/testthat/test-datatype.R @@ -224,18 +224,17 @@ test_that("contains_* functions for datatype work", { }) test_that("Enum", { - # Generate 100 random data frames with random - # orders for levels. They should always match - for (i in 1:100) { - expected_levels = sample(letters, length(letters)) - expected_values = sample(letters, length(letters)) - expect_identical( - as_polars_series(expected_values)$ - cast(pl$Enum(expected_levels))$ - to_r(), - factor(expected_values, levels = expected_levels) - ) - } + quickcheck::for_all( + property = function(factors) { + expect_identical( + as_polars_series(as.character(factors))$ + cast(pl$Enum(levels(factors)))$ + to_r(), + factors + ) + }, + factors = quickcheck::factor_() + ) expect_grepl_error(pl$Enum(), "missing") expect_grepl_error(pl$Enum(1), "invalid series dtype") From 62360539ba6f8300ba7905909fc5fc0854ebb9c5 Mon Sep 17 00:00:00 2001 From: andres Date: Thu, 17 Oct 2024 18:16:49 -0500 Subject: [PATCH 04/10] chore: Adds enum conversion to NEWS --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index bdaf8b2a1..a4ff89051 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,6 +5,7 @@ ## Polars R Package 0.20.0 - Updated rust-polars to 0.43.1 (#1230). +- Maintains level order when converting Enums to factors (#1252, @andyquinterom) ### Breaking changes From 0d2b64ae3811ddec70e20b1c9cb6615ef1ac9e2c Mon Sep 17 00:00:00 2001 From: andres Date: Thu, 17 Oct 2024 18:24:13 -0500 Subject: [PATCH 05/10] chore: Fixes data_frame tests --- tests/testthat/_snaps/dataframe.md | 583 +++++++++++++---------------- 1 file changed, 264 insertions(+), 319 deletions(-) diff --git a/tests/testthat/_snaps/dataframe.md b/tests/testthat/_snaps/dataframe.md index a2d9ac9f5..2b207626e 100644 --- a/tests/testthat/_snaps/dataframe.md +++ b/tests/testthat/_snaps/dataframe.md @@ -4,18 +4,17 @@ df Output shape: (5, 6) - ┌─────────┬──────┬─────┬─────────┬────────┬────────┐ - │ newname ┆ a ┆ b ┆ new_col ┆ named_ ┆ new_co │ - │ --- ┆ --- ┆ --- ┆ umn ┆ vector ┆ lumn_1 │ - │ f64 ┆ f64 ┆ str ┆ --- ┆ --- ┆ --- │ - │ ┆ ┆ ┆ f64 ┆ f64 ┆ f64 │ - ╞═════════╪══════╪═════╪═════════╪════════╪════════╡ - │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ - │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ - │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ - │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ - │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ - └─────────┴──────┴─────┴─────────┴────────┴────────┘ + ┌─────────┬──────┬─────┬────────────┬──────────────┬──────────────┐ + │ newname ┆ a ┆ b ┆ new_column ┆ named_vector ┆ new_column_1 │ + │ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │ + │ f64 ┆ f64 ┆ str ┆ f64 ┆ f64 ┆ f64 │ + ╞═════════╪══════╪═════╪════════════╪══════════════╪══════════════╡ + │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ + │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ + │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ + │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ + │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ + └─────────┴──────┴─────┴────────────┴──────────────┴──────────────┘ # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_CELL_ALIGNMENT, .value=RIGHT @@ -23,36 +22,34 @@ df Output shape: (5, 6) - ┌─────────┬──────┬─────┬─────────┬────────┬────────┐ - │ newname ┆ a ┆ b ┆ new_col ┆ named_ ┆ new_co │ - │ --- ┆ --- ┆ --- ┆ umn ┆ vector ┆ lumn_1 │ - │ f64 ┆ f64 ┆ str ┆ --- ┆ --- ┆ --- │ - │ ┆ ┆ ┆ f64 ┆ f64 ┆ f64 │ - ╞═════════╪══════╪═════╪═════════╪════════╪════════╡ - │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ - │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ - │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ - │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ - │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ - └─────────┴──────┴─────┴─────────┴────────┴────────┘ + ┌─────────┬──────┬─────┬────────────┬──────────────┬──────────────┐ + │ newname ┆ a ┆ b ┆ new_column ┆ named_vector ┆ new_column_1 │ + │ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │ + │ f64 ┆ f64 ┆ str ┆ f64 ┆ f64 ┆ f64 │ + ╞═════════╪══════╪═════╪════════════╪══════════════╪══════════════╡ + │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ + │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ + │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ + │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ + │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ + └─────────┴──────┴─────┴────────────┴──────────────┴──────────────┘ # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_DATAFRAME_SHAPE_BELOW, .value=1 Code df Output - ┌─────────┬──────┬─────┬─────────┬────────┬────────┐ - │ newname ┆ a ┆ b ┆ new_col ┆ named_ ┆ new_co │ - │ --- ┆ --- ┆ --- ┆ umn ┆ vector ┆ lumn_1 │ - │ f64 ┆ f64 ┆ str ┆ --- ┆ --- ┆ --- │ - │ ┆ ┆ ┆ f64 ┆ f64 ┆ f64 │ - ╞═════════╪══════╪═════╪═════════╪════════╪════════╡ - │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ - │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ - │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ - │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ - │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ - └─────────┴──────┴─────┴─────────┴────────┴────────┘ + ┌─────────┬──────┬─────┬────────────┬──────────────┬──────────────┐ + │ newname ┆ a ┆ b ┆ new_column ┆ named_vector ┆ new_column_1 │ + │ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │ + │ f64 ┆ f64 ┆ str ┆ f64 ┆ f64 ┆ f64 │ + ╞═════════╪══════╪═════╪════════════╪══════════════╪══════════════╡ + │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ + │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ + │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ + │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ + │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ + └─────────┴──────┴─────┴────────────┴──────────────┴──────────────┘ shape: (5, 6) # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=ASCII_FULL @@ -61,22 +58,21 @@ df Output shape: (5, 6) - +---------+------+-----+---------+--------+--------+ - | newname | a | b | new_col | named_ | new_co | - | --- | --- | --- | umn | vector | lumn_1 | - | f64 | f64 | str | --- | --- | --- | - | | | | f64 | f64 | f64 | - +==================================================+ - | 1.0 | 5.0 | a | 5.0 | 15.0 | 5.0 | - |---------+------+-----+---------+--------+--------| - | 2.0 | 10.0 | b | 4.0 | 14.0 | 4.0 | - |---------+------+-----+---------+--------+--------| - | 3.0 | 15.0 | c | 3.0 | 13.0 | 3.0 | - |---------+------+-----+---------+--------+--------| - | 4.0 | 20.0 | d | 2.0 | 12.0 | 2.0 | - |---------+------+-----+---------+--------+--------| - | 5.0 | 25.0 | e | 1.0 | 11.0 | 0.0 | - +---------+------+-----+---------+--------+--------+ + +---------+------+-----+------------+--------------+--------------+ + | newname | a | b | new_column | named_vector | new_column_1 | + | --- | --- | --- | --- | --- | --- | + | f64 | f64 | str | f64 | f64 | f64 | + +=================================================================+ + | 1.0 | 5.0 | a | 5.0 | 15.0 | 5.0 | + |---------+------+-----+------------+--------------+--------------| + | 2.0 | 10.0 | b | 4.0 | 14.0 | 4.0 | + |---------+------+-----+------------+--------------+--------------| + | 3.0 | 15.0 | c | 3.0 | 13.0 | 3.0 | + |---------+------+-----+------------+--------------+--------------| + | 4.0 | 20.0 | d | 2.0 | 12.0 | 2.0 | + |---------+------+-----+------------+--------------+--------------| + | 5.0 | 25.0 | e | 1.0 | 11.0 | 0.0 | + +---------+------+-----+------------+--------------+--------------+ # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=ASCII_FULL_CONDENSED @@ -84,18 +80,17 @@ df Output shape: (5, 6) - +---------+------+-----+---------+--------+--------+ - | newname | a | b | new_col | named_ | new_co | - | --- | --- | --- | umn | vector | lumn_1 | - | f64 | f64 | str | --- | --- | --- | - | | | | f64 | f64 | f64 | - +==================================================+ - | 1.0 | 5.0 | a | 5.0 | 15.0 | 5.0 | - | 2.0 | 10.0 | b | 4.0 | 14.0 | 4.0 | - | 3.0 | 15.0 | c | 3.0 | 13.0 | 3.0 | - | 4.0 | 20.0 | d | 2.0 | 12.0 | 2.0 | - | 5.0 | 25.0 | e | 1.0 | 11.0 | 0.0 | - +---------+------+-----+---------+--------+--------+ + +---------+------+-----+------------+--------------+--------------+ + | newname | a | b | new_column | named_vector | new_column_1 | + | --- | --- | --- | --- | --- | --- | + | f64 | f64 | str | f64 | f64 | f64 | + +=================================================================+ + | 1.0 | 5.0 | a | 5.0 | 15.0 | 5.0 | + | 2.0 | 10.0 | b | 4.0 | 14.0 | 4.0 | + | 3.0 | 15.0 | c | 3.0 | 13.0 | 3.0 | + | 4.0 | 20.0 | d | 2.0 | 12.0 | 2.0 | + | 5.0 | 25.0 | e | 1.0 | 11.0 | 0.0 | + +---------+------+-----+------------+--------------+--------------+ # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=ASCII_NO_BORDERS @@ -103,20 +98,19 @@ df Output shape: (5, 6) - newname | a | b | new_col | named_v | new_col - --- | --- | --- | umn | ector | umn_1 - f64 | f64 | str | --- | --- | --- - | | | f64 | f64 | f64 - ==================================================== - 1.0 | 5.0 | a | 5.0 | 15.0 | 5.0 - ---------+------+-----+---------+---------+--------- - 2.0 | 10.0 | b | 4.0 | 14.0 | 4.0 - ---------+------+-----+---------+---------+--------- - 3.0 | 15.0 | c | 3.0 | 13.0 | 3.0 - ---------+------+-----+---------+---------+--------- - 4.0 | 20.0 | d | 2.0 | 12.0 | 2.0 - ---------+------+-----+---------+---------+--------- - 5.0 | 25.0 | e | 1.0 | 11.0 | 0.0 + newname | a | b | new_column | named_vector | new_column_1 + --- | --- | --- | --- | --- | --- + f64 | f64 | str | f64 | f64 | f64 + ================================================================= + 1.0 | 5.0 | a | 5.0 | 15.0 | 5.0 + ---------+------+-----+------------+--------------+-------------- + 2.0 | 10.0 | b | 4.0 | 14.0 | 4.0 + ---------+------+-----+------------+--------------+-------------- + 3.0 | 15.0 | c | 3.0 | 13.0 | 3.0 + ---------+------+-----+------------+--------------+-------------- + 4.0 | 20.0 | d | 2.0 | 12.0 | 2.0 + ---------+------+-----+------------+--------------+-------------- + 5.0 | 25.0 | e | 1.0 | 11.0 | 0.0 # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=ASCII_BORDERS_ONLY @@ -124,22 +118,21 @@ df Output shape: (5, 6) - +--------------------------------------------------+ - | newname a b new_col named_ new_co | - | --- --- --- umn vector lumn_1 | - | f64 f64 str --- --- --- | - | f64 f64 f64 | - +==================================================+ - | 1.0 5.0 a 5.0 15.0 5.0 | - | | - | 2.0 10.0 b 4.0 14.0 4.0 | - | | - | 3.0 15.0 c 3.0 13.0 3.0 | - | | - | 4.0 20.0 d 2.0 12.0 2.0 | - | | - | 5.0 25.0 e 1.0 11.0 0.0 | - +--------------------------------------------------+ + +-----------------------------------------------------------------+ + | newname a b new_column named_vector new_column_1 | + | --- --- --- --- --- --- | + | f64 f64 str f64 f64 f64 | + +=================================================================+ + | 1.0 5.0 a 5.0 15.0 5.0 | + | | + | 2.0 10.0 b 4.0 14.0 4.0 | + | | + | 3.0 15.0 c 3.0 13.0 3.0 | + | | + | 4.0 20.0 d 2.0 12.0 2.0 | + | | + | 5.0 25.0 e 1.0 11.0 0.0 | + +-----------------------------------------------------------------+ # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=ASCII_BORDERS_ONLY_CONDENSED @@ -147,18 +140,17 @@ df Output shape: (5, 6) - +--------------------------------------------------+ - | newname a b new_col named_ new_co | - | --- --- --- umn vector lumn_1 | - | f64 f64 str --- --- --- | - | f64 f64 f64 | - +==================================================+ - | 1.0 5.0 a 5.0 15.0 5.0 | - | 2.0 10.0 b 4.0 14.0 4.0 | - | 3.0 15.0 c 3.0 13.0 3.0 | - | 4.0 20.0 d 2.0 12.0 2.0 | - | 5.0 25.0 e 1.0 11.0 0.0 | - +--------------------------------------------------+ + +-----------------------------------------------------------------+ + | newname a b new_column named_vector new_column_1 | + | --- --- --- --- --- --- | + | f64 f64 str f64 f64 f64 | + +=================================================================+ + | 1.0 5.0 a 5.0 15.0 5.0 | + | 2.0 10.0 b 4.0 14.0 4.0 | + | 3.0 15.0 c 3.0 13.0 3.0 | + | 4.0 20.0 d 2.0 12.0 2.0 | + | 5.0 25.0 e 1.0 11.0 0.0 | + +-----------------------------------------------------------------+ # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=ASCII_HORIZONTAL_ONLY @@ -166,22 +158,21 @@ df Output shape: (5, 6) - ---------------------------------------------------- - newname a b new_col named_v new_col - --- --- --- umn ector umn_1 - f64 f64 str --- --- --- - f64 f64 f64 - ==================================================== - 1.0 5.0 a 5.0 15.0 5.0 - ---------------------------------------------------- - 2.0 10.0 b 4.0 14.0 4.0 - ---------------------------------------------------- - 3.0 15.0 c 3.0 13.0 3.0 - ---------------------------------------------------- - 4.0 20.0 d 2.0 12.0 2.0 - ---------------------------------------------------- - 5.0 25.0 e 1.0 11.0 0.0 - ---------------------------------------------------- + ----------------------------------------------------------------- + newname a b new_column named_vector new_column_1 + --- --- --- --- --- --- + f64 f64 str f64 f64 f64 + ================================================================= + 1.0 5.0 a 5.0 15.0 5.0 + ----------------------------------------------------------------- + 2.0 10.0 b 4.0 14.0 4.0 + ----------------------------------------------------------------- + 3.0 15.0 c 3.0 13.0 3.0 + ----------------------------------------------------------------- + 4.0 20.0 d 2.0 12.0 2.0 + ----------------------------------------------------------------- + 5.0 25.0 e 1.0 11.0 0.0 + ----------------------------------------------------------------- # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=ASCII_MARKDOWN @@ -189,16 +180,15 @@ df Output shape: (5, 6) - | newname | a | b | new_col | named_ | new_co | - | --- | --- | --- | umn | vector | lumn_1 | - | f64 | f64 | str | --- | --- | --- | - | | | | f64 | f64 | f64 | - |---------|------|-----|---------|--------|--------| - | 1.0 | 5.0 | a | 5.0 | 15.0 | 5.0 | - | 2.0 | 10.0 | b | 4.0 | 14.0 | 4.0 | - | 3.0 | 15.0 | c | 3.0 | 13.0 | 3.0 | - | 4.0 | 20.0 | d | 2.0 | 12.0 | 2.0 | - | 5.0 | 25.0 | e | 1.0 | 11.0 | 0.0 | + | newname | a | b | new_column | named_vector | new_column_1 | + | --- | --- | --- | --- | --- | --- | + | f64 | f64 | str | f64 | f64 | f64 | + |---------|------|-----|------------|--------------|--------------| + | 1.0 | 5.0 | a | 5.0 | 15.0 | 5.0 | + | 2.0 | 10.0 | b | 4.0 | 14.0 | 4.0 | + | 3.0 | 15.0 | c | 3.0 | 13.0 | 3.0 | + | 4.0 | 20.0 | d | 2.0 | 12.0 | 2.0 | + | 5.0 | 25.0 | e | 1.0 | 11.0 | 0.0 | # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=UTF8_FULL @@ -206,22 +196,21 @@ df Output shape: (5, 6) - ┌─────────┬──────┬─────┬─────────┬────────┬────────┐ - │ newname ┆ a ┆ b ┆ new_col ┆ named_ ┆ new_co │ - │ --- ┆ --- ┆ --- ┆ umn ┆ vector ┆ lumn_1 │ - │ f64 ┆ f64 ┆ str ┆ --- ┆ --- ┆ --- │ - │ ┆ ┆ ┆ f64 ┆ f64 ┆ f64 │ - ╞═════════╪══════╪═════╪═════════╪════════╪════════╡ - │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ - ├╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤ - │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ - ├╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤ - │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ - ├╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤ - │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ - ├╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤ - │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ - └─────────┴──────┴─────┴─────────┴────────┴────────┘ + ┌─────────┬──────┬─────┬────────────┬──────────────┬──────────────┐ + │ newname ┆ a ┆ b ┆ new_column ┆ named_vector ┆ new_column_1 │ + │ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │ + │ f64 ┆ f64 ┆ str ┆ f64 ┆ f64 ┆ f64 │ + ╞═════════╪══════╪═════╪════════════╪══════════════╪══════════════╡ + │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ + ├╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ + │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ + ├╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ + │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ + ├╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ + │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ + ├╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤ + │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ + └─────────┴──────┴─────┴────────────┴──────────────┴──────────────┘ # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=UTF8_FULL_CONDENSED @@ -229,18 +218,17 @@ df Output shape: (5, 6) - ┌─────────┬──────┬─────┬─────────┬────────┬────────┐ - │ newname ┆ a ┆ b ┆ new_col ┆ named_ ┆ new_co │ - │ --- ┆ --- ┆ --- ┆ umn ┆ vector ┆ lumn_1 │ - │ f64 ┆ f64 ┆ str ┆ --- ┆ --- ┆ --- │ - │ ┆ ┆ ┆ f64 ┆ f64 ┆ f64 │ - ╞═════════╪══════╪═════╪═════════╪════════╪════════╡ - │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ - │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ - │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ - │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ - │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ - └─────────┴──────┴─────┴─────────┴────────┴────────┘ + ┌─────────┬──────┬─────┬────────────┬──────────────┬──────────────┐ + │ newname ┆ a ┆ b ┆ new_column ┆ named_vector ┆ new_column_1 │ + │ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │ + │ f64 ┆ f64 ┆ str ┆ f64 ┆ f64 ┆ f64 │ + ╞═════════╪══════╪═════╪════════════╪══════════════╪══════════════╡ + │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ + │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ + │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ + │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ + │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ + └─────────┴──────┴─────┴────────────┴──────────────┴──────────────┘ # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=UTF8_NO_BORDERS @@ -248,20 +236,19 @@ df Output shape: (5, 6) - newname ┆ a ┆ b ┆ new_col ┆ named_v ┆ new_col - --- ┆ --- ┆ --- ┆ umn ┆ ector ┆ umn_1 - f64 ┆ f64 ┆ str ┆ --- ┆ --- ┆ --- - ┆ ┆ ┆ f64 ┆ f64 ┆ f64 - ═════════╪══════╪═════╪═════════╪═════════╪═════════ - 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 - ╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌ - 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 - ╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌ - 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 - ╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌ - 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 - ╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌ - 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 + newname ┆ a ┆ b ┆ new_column ┆ named_vector ┆ new_column_1 + --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- + f64 ┆ f64 ┆ str ┆ f64 ┆ f64 ┆ f64 + ═════════╪══════╪═════╪════════════╪══════════════╪══════════════ + 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 + ╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌ + 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 + ╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌ + 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 + ╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌ + 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 + ╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌ + 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=UTF8_BORDERS_ONLY @@ -269,18 +256,17 @@ df Output shape: (5, 6) - ┌──────────────────────────────────────────────────┐ - │ newname a b new_col named_ new_co │ - │ --- --- --- umn vector lumn_1 │ - │ f64 f64 str --- --- --- │ - │ f64 f64 f64 │ - ╞══════════════════════════════════════════════════╡ - │ 1.0 5.0 a 5.0 15.0 5.0 │ - │ 2.0 10.0 b 4.0 14.0 4.0 │ - │ 3.0 15.0 c 3.0 13.0 3.0 │ - │ 4.0 20.0 d 2.0 12.0 2.0 │ - │ 5.0 25.0 e 1.0 11.0 0.0 │ - └──────────────────────────────────────────────────┘ + ┌─────────────────────────────────────────────────────────────────┐ + │ newname a b new_column named_vector new_column_1 │ + │ --- --- --- --- --- --- │ + │ f64 f64 str f64 f64 f64 │ + ╞═════════════════════════════════════════════════════════════════╡ + │ 1.0 5.0 a 5.0 15.0 5.0 │ + │ 2.0 10.0 b 4.0 14.0 4.0 │ + │ 3.0 15.0 c 3.0 13.0 3.0 │ + │ 4.0 20.0 d 2.0 12.0 2.0 │ + │ 5.0 25.0 e 1.0 11.0 0.0 │ + └─────────────────────────────────────────────────────────────────┘ # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=UTF8_HORIZONTAL_ONLY @@ -288,22 +274,21 @@ df Output shape: (5, 6) - ──────────────────────────────────────────────────── - newname a b new_col named_v new_col - --- --- --- umn ector umn_1 - f64 f64 str --- --- --- - f64 f64 f64 - ════════════════════════════════════════════════════ - 1.0 5.0 a 5.0 15.0 5.0 - ──────────────────────────────────────────────────── - 2.0 10.0 b 4.0 14.0 4.0 - ──────────────────────────────────────────────────── - 3.0 15.0 c 3.0 13.0 3.0 - ──────────────────────────────────────────────────── - 4.0 20.0 d 2.0 12.0 2.0 - ──────────────────────────────────────────────────── - 5.0 25.0 e 1.0 11.0 0.0 - ──────────────────────────────────────────────────── + ───────────────────────────────────────────────────────────────── + newname a b new_column named_vector new_column_1 + --- --- --- --- --- --- + f64 f64 str f64 f64 f64 + ═════════════════════════════════════════════════════════════════ + 1.0 5.0 a 5.0 15.0 5.0 + ───────────────────────────────────────────────────────────────── + 2.0 10.0 b 4.0 14.0 4.0 + ───────────────────────────────────────────────────────────────── + 3.0 15.0 c 3.0 13.0 3.0 + ───────────────────────────────────────────────────────────────── + 4.0 20.0 d 2.0 12.0 2.0 + ───────────────────────────────────────────────────────────────── + 5.0 25.0 e 1.0 11.0 0.0 + ───────────────────────────────────────────────────────────────── # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_FORMATTING, .value=NOTHING @@ -311,15 +296,14 @@ df Output shape: (5, 6) - newname a b new_colum named_vec new_colu - --- --- --- n tor mn_1 - f64 f64 str --- --- --- - f64 f64 f64 - 1.0 5.0 a 5.0 15.0 5.0 - 2.0 10.0 b 4.0 14.0 4.0 - 3.0 15.0 c 3.0 13.0 3.0 - 4.0 20.0 d 2.0 12.0 2.0 - 5.0 25.0 e 1.0 11.0 0.0 + newname a b new_column named_vector new_column_1 + --- --- --- --- --- --- + f64 f64 str f64 f64 f64 + 1.0 5.0 a 5.0 15.0 5.0 + 2.0 10.0 b 4.0 14.0 4.0 + 3.0 15.0 c 3.0 13.0 3.0 + 4.0 20.0 d 2.0 12.0 2.0 + 5.0 25.0 e 1.0 11.0 0.0 # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_HIDE_COLUMN_DATA_TYPES, .value=1 @@ -327,16 +311,15 @@ df Output shape: (5, 6) - ┌─────────┬──────┬───┬─────────┬─────────┬─────────┐ - │ newname ┆ a ┆ b ┆ new_col ┆ named_v ┆ new_col │ - │ ┆ ┆ ┆ umn ┆ ector ┆ umn_1 │ - ╞═════════╪══════╪═══╪═════════╪═════════╪═════════╡ - │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ - │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ - │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ - │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ - │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ - └─────────┴──────┴───┴─────────┴─────────┴─────────┘ + ┌─────────┬──────┬───┬────────────┬──────────────┬──────────────┐ + │ newname ┆ a ┆ b ┆ new_column ┆ named_vector ┆ new_column_1 │ + ╞═════════╪══════╪═══╪════════════╪══════════════╪══════════════╡ + │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ + │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ + │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ + │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ + │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ + └─────────┴──────┴───┴────────────┴──────────────┴──────────────┘ # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_HIDE_COLUMN_NAMES, .value=1 @@ -360,35 +343,33 @@ df Output shape: (5, 6) - ┌─────────┬──────┬─────┬─────────┬────────┬────────┐ - │ newname ┆ a ┆ b ┆ new_col ┆ named_ ┆ new_co │ - │ f64 ┆ f64 ┆ str ┆ umn ┆ vector ┆ lumn_1 │ - │ ┆ ┆ ┆ f64 ┆ f64 ┆ f64 │ - ╞═════════╪══════╪═════╪═════════╪════════╪════════╡ - │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ - │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ - │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ - │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ - │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ - └─────────┴──────┴─────┴─────────┴────────┴────────┘ + ┌─────────┬──────┬─────┬────────────┬──────────────┬──────────────┐ + │ newname ┆ a ┆ b ┆ new_column ┆ named_vector ┆ new_column_1 │ + │ f64 ┆ f64 ┆ str ┆ f64 ┆ f64 ┆ f64 │ + ╞═════════╪══════╪═════╪════════════╪══════════════╪══════════════╡ + │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ + │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ + │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ + │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ + │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ + └─────────┴──────┴─────┴────────────┴──────────────┴──────────────┘ # DataFrame, mixed input, create and print .name=POLARS_FMT_TABLE_HIDE_DATAFRAME_SHAPE_INFORMATION, .value=1 Code df Output - ┌─────────┬──────┬─────┬─────────┬────────┬────────┐ - │ newname ┆ a ┆ b ┆ new_col ┆ named_ ┆ new_co │ - │ --- ┆ --- ┆ --- ┆ umn ┆ vector ┆ lumn_1 │ - │ f64 ┆ f64 ┆ str ┆ --- ┆ --- ┆ --- │ - │ ┆ ┆ ┆ f64 ┆ f64 ┆ f64 │ - ╞═════════╪══════╪═════╪═════════╪════════╪════════╡ - │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ - │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ - │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ - │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ - │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ - └─────────┴──────┴─────┴─────────┴────────┴────────┘ + ┌─────────┬──────┬─────┬────────────┬──────────────┬──────────────┐ + │ newname ┆ a ┆ b ┆ new_column ┆ named_vector ┆ new_column_1 │ + │ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │ + │ f64 ┆ f64 ┆ str ┆ f64 ┆ f64 ┆ f64 │ + ╞═════════╪══════╪═════╪════════════╪══════════════╪══════════════╡ + │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ + │ 2.0 ┆ 10.0 ┆ b ┆ 4.0 ┆ 14.0 ┆ 4.0 │ + │ 3.0 ┆ 15.0 ┆ c ┆ 3.0 ┆ 13.0 ┆ 3.0 │ + │ 4.0 ┆ 20.0 ┆ d ┆ 2.0 ┆ 12.0 ┆ 2.0 │ + │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ + └─────────┴──────┴─────┴────────────┴──────────────┴──────────────┘ # DataFrame, mixed input, create and print .name=POLARS_FMT_MAX_ROWS, .value=2 @@ -396,16 +377,15 @@ df Output shape: (5, 6) - ┌─────────┬──────┬─────┬─────────┬────────┬────────┐ - │ newname ┆ a ┆ b ┆ new_col ┆ named_ ┆ new_co │ - │ --- ┆ --- ┆ --- ┆ umn ┆ vector ┆ lumn_1 │ - │ f64 ┆ f64 ┆ str ┆ --- ┆ --- ┆ --- │ - │ ┆ ┆ ┆ f64 ┆ f64 ┆ f64 │ - ╞═════════╪══════╪═════╪═════════╪════════╪════════╡ - │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ - │ … ┆ … ┆ … ┆ … ┆ … ┆ … │ - │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ - └─────────┴──────┴─────┴─────────┴────────┴────────┘ + ┌─────────┬──────┬─────┬────────────┬──────────────┬──────────────┐ + │ newname ┆ a ┆ b ┆ new_column ┆ named_vector ┆ new_column_1 │ + │ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │ + │ f64 ┆ f64 ┆ str ┆ f64 ┆ f64 ┆ f64 │ + ╞═════════╪══════╪═════╪════════════╪══════════════╪══════════════╡ + │ 1.0 ┆ 5.0 ┆ a ┆ 5.0 ┆ 15.0 ┆ 5.0 │ + │ … ┆ … ┆ … ┆ … ┆ … ┆ … │ + │ 5.0 ┆ 25.0 ┆ e ┆ 1.0 ┆ 11.0 ┆ 0.0 │ + └─────────┴──────┴─────┴────────────┴──────────────┴──────────────┘ # describe @@ -435,38 +415,21 @@ pl$DataFrame(mtcars)$describe() Output shape: (9, 12) - ┌─────┬─────┬─────┬─────┬───┬─────┬─────┬─────┬─────┐ - │ sta ┆ mpg ┆ cyl ┆ dis ┆ … ┆ vs ┆ am ┆ gea ┆ car │ - │ tis ┆ --- ┆ --- ┆ p ┆ ┆ --- ┆ --- ┆ r ┆ b │ - │ tic ┆ f64 ┆ f64 ┆ --- ┆ ┆ f64 ┆ f64 ┆ --- ┆ --- │ - │ --- ┆ ┆ ┆ f64 ┆ ┆ ┆ ┆ f64 ┆ f64 │ - │ str ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ - ╞═════╪═════╪═════╪═════╪═══╪═════╪═════╪═════╪═════╡ - │ cou ┆ 32. ┆ 32. ┆ 32. ┆ … ┆ 32. ┆ 32. ┆ 32. ┆ 32. │ - │ nt ┆ 0 ┆ 0 ┆ 0 ┆ ┆ 0 ┆ 0 ┆ 0 ┆ 0 │ - │ nul ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ … ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 │ - │ l_c ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ - │ oun ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ - │ t ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ - │ mea ┆ 20. ┆ 6.1 ┆ 230 ┆ … ┆ 0.4 ┆ 0.4 ┆ 3.6 ┆ 2.8 │ - │ n ┆ 090 ┆ 875 ┆ .72 ┆ ┆ 375 ┆ 062 ┆ 875 ┆ 125 │ - │ ┆ 625 ┆ ┆ 187 ┆ ┆ ┆ 5 ┆ ┆ │ - │ ┆ ┆ ┆ 5 ┆ ┆ ┆ ┆ ┆ │ - │ std ┆ 6.0 ┆ 1.7 ┆ 123 ┆ … ┆ 0.5 ┆ 0.4 ┆ 0.7 ┆ 1.6 │ - │ ┆ 269 ┆ 859 ┆ .93 ┆ ┆ 040 ┆ 989 ┆ 378 ┆ 152 │ - │ ┆ 48 ┆ 22 ┆ 869 ┆ ┆ 16 ┆ 91 ┆ 04 ┆ │ - │ ┆ ┆ ┆ 4 ┆ ┆ ┆ ┆ ┆ │ - │ min ┆ 10. ┆ 4.0 ┆ 71. ┆ … ┆ 0.0 ┆ 0.0 ┆ 3.0 ┆ 1.0 │ - │ ┆ 4 ┆ ┆ 1 ┆ ┆ ┆ ┆ ┆ │ - │ 25% ┆ 15. ┆ 4.0 ┆ 121 ┆ … ┆ 0.0 ┆ 0.0 ┆ 3.0 ┆ 2.0 │ - │ ┆ 5 ┆ ┆ .0 ┆ ┆ ┆ ┆ ┆ │ - │ 50% ┆ 19. ┆ 6.0 ┆ 225 ┆ … ┆ 0.0 ┆ 0.0 ┆ 4.0 ┆ 2.0 │ - │ ┆ 2 ┆ ┆ .0 ┆ ┆ ┆ ┆ ┆ │ - │ 75% ┆ 22. ┆ 8.0 ┆ 318 ┆ … ┆ 1.0 ┆ 1.0 ┆ 4.0 ┆ 4.0 │ - │ ┆ 8 ┆ ┆ .0 ┆ ┆ ┆ ┆ ┆ │ - │ max ┆ 33. ┆ 8.0 ┆ 472 ┆ … ┆ 1.0 ┆ 1.0 ┆ 5.0 ┆ 8.0 │ - │ ┆ 9 ┆ ┆ .0 ┆ ┆ ┆ ┆ ┆ │ - └─────┴─────┴─────┴─────┴───┴─────┴─────┴─────┴─────┘ + ┌────────────┬───────────┬──────────┬────────────┬───┬──────────┬──────────┬──────────┬────────┐ + │ statistic ┆ mpg ┆ cyl ┆ disp ┆ … ┆ vs ┆ am ┆ gear ┆ carb │ + │ --- ┆ --- ┆ --- ┆ --- ┆ ┆ --- ┆ --- ┆ --- ┆ --- │ + │ str ┆ f64 ┆ f64 ┆ f64 ┆ ┆ f64 ┆ f64 ┆ f64 ┆ f64 │ + ╞════════════╪═══════════╪══════════╪════════════╪═══╪══════════╪══════════╪══════════╪════════╡ + │ count ┆ 32.0 ┆ 32.0 ┆ 32.0 ┆ … ┆ 32.0 ┆ 32.0 ┆ 32.0 ┆ 32.0 │ + │ null_count ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ … ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 │ + │ mean ┆ 20.090625 ┆ 6.1875 ┆ 230.721875 ┆ … ┆ 0.4375 ┆ 0.40625 ┆ 3.6875 ┆ 2.8125 │ + │ std ┆ 6.026948 ┆ 1.785922 ┆ 123.938694 ┆ … ┆ 0.504016 ┆ 0.498991 ┆ 0.737804 ┆ 1.6152 │ + │ min ┆ 10.4 ┆ 4.0 ┆ 71.1 ┆ … ┆ 0.0 ┆ 0.0 ┆ 3.0 ┆ 1.0 │ + │ 25% ┆ 15.5 ┆ 4.0 ┆ 121.0 ┆ … ┆ 0.0 ┆ 0.0 ┆ 3.0 ┆ 2.0 │ + │ 50% ┆ 19.2 ┆ 6.0 ┆ 225.0 ┆ … ┆ 0.0 ┆ 0.0 ┆ 4.0 ┆ 2.0 │ + │ 75% ┆ 22.8 ┆ 8.0 ┆ 318.0 ┆ … ┆ 1.0 ┆ 1.0 ┆ 4.0 ┆ 4.0 │ + │ max ┆ 33.9 ┆ 8.0 ┆ 472.0 ┆ … ┆ 1.0 ┆ 1.0 ┆ 5.0 ┆ 8.0 │ + └────────────┴───────────┴──────────┴────────────┴───┴──────────┴──────────┴──────────┴────────┘ --- @@ -474,39 +437,21 @@ pl$DataFrame(mtcars)$describe(interpolation = "linear") Output shape: (9, 12) - ┌─────┬─────┬─────┬─────┬───┬─────┬─────┬─────┬─────┐ - │ sta ┆ mpg ┆ cyl ┆ dis ┆ … ┆ vs ┆ am ┆ gea ┆ car │ - │ tis ┆ --- ┆ --- ┆ p ┆ ┆ --- ┆ --- ┆ r ┆ b │ - │ tic ┆ f64 ┆ f64 ┆ --- ┆ ┆ f64 ┆ f64 ┆ --- ┆ --- │ - │ --- ┆ ┆ ┆ f64 ┆ ┆ ┆ ┆ f64 ┆ f64 │ - │ str ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ - ╞═════╪═════╪═════╪═════╪═══╪═════╪═════╪═════╪═════╡ - │ cou ┆ 32. ┆ 32. ┆ 32. ┆ … ┆ 32. ┆ 32. ┆ 32. ┆ 32. │ - │ nt ┆ 0 ┆ 0 ┆ 0 ┆ ┆ 0 ┆ 0 ┆ 0 ┆ 0 │ - │ nul ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ … ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 │ - │ l_c ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ - │ oun ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ - │ t ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ - │ mea ┆ 20. ┆ 6.1 ┆ 230 ┆ … ┆ 0.4 ┆ 0.4 ┆ 3.6 ┆ 2.8 │ - │ n ┆ 090 ┆ 875 ┆ .72 ┆ ┆ 375 ┆ 062 ┆ 875 ┆ 125 │ - │ ┆ 625 ┆ ┆ 187 ┆ ┆ ┆ 5 ┆ ┆ │ - │ ┆ ┆ ┆ 5 ┆ ┆ ┆ ┆ ┆ │ - │ std ┆ 6.0 ┆ 1.7 ┆ 123 ┆ … ┆ 0.5 ┆ 0.4 ┆ 0.7 ┆ 1.6 │ - │ ┆ 269 ┆ 859 ┆ .93 ┆ ┆ 040 ┆ 989 ┆ 378 ┆ 152 │ - │ ┆ 48 ┆ 22 ┆ 869 ┆ ┆ 16 ┆ 91 ┆ 04 ┆ │ - │ ┆ ┆ ┆ 4 ┆ ┆ ┆ ┆ ┆ │ - │ min ┆ 10. ┆ 4.0 ┆ 71. ┆ … ┆ 0.0 ┆ 0.0 ┆ 3.0 ┆ 1.0 │ - │ ┆ 4 ┆ ┆ 1 ┆ ┆ ┆ ┆ ┆ │ - │ 25% ┆ 15. ┆ 4.0 ┆ 120 ┆ … ┆ 0.0 ┆ 0.0 ┆ 3.0 ┆ 2.0 │ - │ ┆ 425 ┆ ┆ .82 ┆ ┆ ┆ ┆ ┆ │ - │ ┆ ┆ ┆ 5 ┆ ┆ ┆ ┆ ┆ │ - │ 50% ┆ 19. ┆ 6.0 ┆ 196 ┆ … ┆ 0.0 ┆ 0.0 ┆ 4.0 ┆ 2.0 │ - │ ┆ 2 ┆ ┆ .3 ┆ ┆ ┆ ┆ ┆ │ - │ 75% ┆ 22. ┆ 8.0 ┆ 326 ┆ … ┆ 1.0 ┆ 1.0 ┆ 4.0 ┆ 4.0 │ - │ ┆ 8 ┆ ┆ .0 ┆ ┆ ┆ ┆ ┆ │ - │ max ┆ 33. ┆ 8.0 ┆ 472 ┆ … ┆ 1.0 ┆ 1.0 ┆ 5.0 ┆ 8.0 │ - │ ┆ 9 ┆ ┆ .0 ┆ ┆ ┆ ┆ ┆ │ - └─────┴─────┴─────┴─────┴───┴─────┴─────┴─────┴─────┘ + ┌────────────┬───────────┬──────────┬────────────┬───┬──────────┬──────────┬──────────┬────────┐ + │ statistic ┆ mpg ┆ cyl ┆ disp ┆ … ┆ vs ┆ am ┆ gear ┆ carb │ + │ --- ┆ --- ┆ --- ┆ --- ┆ ┆ --- ┆ --- ┆ --- ┆ --- │ + │ str ┆ f64 ┆ f64 ┆ f64 ┆ ┆ f64 ┆ f64 ┆ f64 ┆ f64 │ + ╞════════════╪═══════════╪══════════╪════════════╪═══╪══════════╪══════════╪══════════╪════════╡ + │ count ┆ 32.0 ┆ 32.0 ┆ 32.0 ┆ … ┆ 32.0 ┆ 32.0 ┆ 32.0 ┆ 32.0 │ + │ null_count ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ … ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 │ + │ mean ┆ 20.090625 ┆ 6.1875 ┆ 230.721875 ┆ … ┆ 0.4375 ┆ 0.40625 ┆ 3.6875 ┆ 2.8125 │ + │ std ┆ 6.026948 ┆ 1.785922 ┆ 123.938694 ┆ … ┆ 0.504016 ┆ 0.498991 ┆ 0.737804 ┆ 1.6152 │ + │ min ┆ 10.4 ┆ 4.0 ┆ 71.1 ┆ … ┆ 0.0 ┆ 0.0 ┆ 3.0 ┆ 1.0 │ + │ 25% ┆ 15.425 ┆ 4.0 ┆ 120.825 ┆ … ┆ 0.0 ┆ 0.0 ┆ 3.0 ┆ 2.0 │ + │ 50% ┆ 19.2 ┆ 6.0 ┆ 196.3 ┆ … ┆ 0.0 ┆ 0.0 ┆ 4.0 ┆ 2.0 │ + │ 75% ┆ 22.8 ┆ 8.0 ┆ 326.0 ┆ … ┆ 1.0 ┆ 1.0 ┆ 4.0 ┆ 4.0 │ + │ max ┆ 33.9 ┆ 8.0 ┆ 472.0 ┆ … ┆ 1.0 ┆ 1.0 ┆ 5.0 ┆ 8.0 │ + └────────────┴───────────┴──────────┴────────────┴───┴──────────┴──────────┴──────────┴────────┘ --- From 54fc6d3cb21248508eef23fac8432711b21bd6cd Mon Sep 17 00:00:00 2001 From: andres Date: Thu, 17 Oct 2024 18:25:56 -0500 Subject: [PATCH 06/10] chore: Fixes description and news --- DESCRIPTION | 2 +- NEWS.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 7368f5fbc..5cc81608d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -117,7 +117,7 @@ Collate: 'sql.R' 'vctrs.R' 'zzz.R' -Config/rextendr/version: 0.3.1.9000 +Config/rextendr/version: 0.3.1 VignetteBuilder: knitr Config/polars/LibVersion: 0.43.0 Config/polars/RustToolchainVersion: nightly-2024-09-19 diff --git a/NEWS.md b/NEWS.md index a4ff89051..9dc106a8f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,10 +2,11 @@ ## Polars R Package (development version) +- Maintains level order when converting Enums to factors (#1252, @andyquinterom) + ## Polars R Package 0.20.0 - Updated rust-polars to 0.43.1 (#1230). -- Maintains level order when converting Enums to factors (#1252, @andyquinterom) ### Breaking changes From 279b1c8d084db306af1a5024e88cb321481a50b8 Mon Sep 17 00:00:00 2001 From: andres Date: Thu, 17 Oct 2024 19:39:06 -0500 Subject: [PATCH 07/10] chore: Bumps version to 0.44 --- DESCRIPTION | 2 +- src/rust/Cargo.toml | 2 +- tools/lib-sums.tsv | 6 ------ 3 files changed, 2 insertions(+), 8 deletions(-) delete mode 100644 tools/lib-sums.tsv diff --git a/DESCRIPTION b/DESCRIPTION index 5cc81608d..22cd0cd0d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -119,5 +119,5 @@ Collate: 'zzz.R' Config/rextendr/version: 0.3.1 VignetteBuilder: knitr -Config/polars/LibVersion: 0.43.0 +Config/polars/LibVersion: 0.44.0 Config/polars/RustToolchainVersion: nightly-2024-09-19 diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml index 0c115bc95..1bf53228e 100644 --- a/src/rust/Cargo.toml +++ b/src/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "r-polars" -version = "0.43.0" +version = "0.44.0" edition = "2021" rust-version = "1.80.0" publish = false diff --git a/tools/lib-sums.tsv b/tools/lib-sums.tsv deleted file mode 100644 index 8fe98f387..000000000 --- a/tools/lib-sums.tsv +++ /dev/null @@ -1,6 +0,0 @@ -url sha256sum -https://github.com/pola-rs/r-polars/releases/download/lib-v0.43.0/libr_polars-0.43.0-aarch64-apple-darwin.tar.gz 6b81c785078894eba575d5c53210afacd47cd4f5a346dc74958d500d34b4cb84 -https://github.com/pola-rs/r-polars/releases/download/lib-v0.43.0/libr_polars-0.43.0-aarch64-unknown-linux-gnu.tar.gz cc727b05816fac13e8223e4f23077ef931c2351d1b20ac8848e70bf52d9f7d34 -https://github.com/pola-rs/r-polars/releases/download/lib-v0.43.0/libr_polars-0.43.0-x86_64-apple-darwin.tar.gz 5d23f27814fb3de60783acaad8594897f60f16f4b7ec94344f4bbaffaad5cca6 -https://github.com/pola-rs/r-polars/releases/download/lib-v0.43.0/libr_polars-0.43.0-x86_64-pc-windows-gnu.tar.gz 5b1120f2cda482ee734f3952eb6c3aa2c56286280c109cdf897a9eb3bcddae4f -https://github.com/pola-rs/r-polars/releases/download/lib-v0.43.0/libr_polars-0.43.0-x86_64-unknown-linux-gnu.tar.gz 0831fa1beed3847008eaa8f993199e895c68c9fc548696574dafd77ca431259e From fe4afb8143e4551ffc0db726b692a347e1789920 Mon Sep 17 00:00:00 2001 From: etiennebacher Date: Fri, 18 Oct 2024 10:00:21 +0200 Subject: [PATCH 08/10] minor changes --- NEWS.md | 4 +++- tests/testthat/test-datatype.R | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 9dc106a8f..7d8dc994a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,7 +2,9 @@ ## Polars R Package (development version) -- Maintains level order when converting Enums to factors (#1252, @andyquinterom) +### Bug fixes + +- Maintain level order when converting Enums to factors (#1252, @andyquinterom). ## Polars R Package 0.20.0 diff --git a/tests/testthat/test-datatype.R b/tests/testthat/test-datatype.R index 11aac3d15..e023c4232 100644 --- a/tests/testthat/test-datatype.R +++ b/tests/testthat/test-datatype.R @@ -225,6 +225,7 @@ test_that("contains_* functions for datatype work", { test_that("Enum", { quickcheck::for_all( + factors = quickcheck::factor_(), property = function(factors) { expect_identical( as_polars_series(as.character(factors))$ @@ -232,8 +233,7 @@ test_that("Enum", { to_r(), factors ) - }, - factors = quickcheck::factor_() + } ) expect_grepl_error(pl$Enum(), "missing") From f33b96987cfd37ac241cbd608b306d03edb54559 Mon Sep 17 00:00:00 2001 From: eitsupi <50911393+eitsupi@users.noreply.github.com> Date: Fri, 18 Oct 2024 18:22:19 +0900 Subject: [PATCH 09/10] Apply suggestions from code review --- DESCRIPTION | 2 +- src/rust/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 22cd0cd0d..d6b2a434b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -119,5 +119,5 @@ Collate: 'zzz.R' Config/rextendr/version: 0.3.1 VignetteBuilder: knitr -Config/polars/LibVersion: 0.44.0 +Config/polars/LibVersion: 0.43.1 Config/polars/RustToolchainVersion: nightly-2024-09-19 diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml index 1bf53228e..494c96413 100644 --- a/src/rust/Cargo.toml +++ b/src/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "r-polars" -version = "0.44.0" +version = "0.43.1" edition = "2021" rust-version = "1.80.0" publish = false From 2cd2c3478366e42091bc0e3d42489321c8bf29f9 Mon Sep 17 00:00:00 2001 From: eitsupi Date: Sat, 19 Oct 2024 11:59:31 +0000 Subject: [PATCH 10/10] chore: auto update lock file --- src/rust/Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rust/Cargo.lock b/src/rust/Cargo.lock index 86cb8c733..3b33c0f53 100644 --- a/src/rust/Cargo.lock +++ b/src/rust/Cargo.lock @@ -2277,7 +2277,7 @@ dependencies = [ [[package]] name = "r-polars" -version = "0.43.0" +version = "0.43.1" dependencies = [ "either", "extendr-api",