From bc24e12b92fd1e8e1f2fc697fa224fffc51619fb Mon Sep 17 00:00:00 2001 From: Darek Date: Mon, 16 Sep 2024 13:45:35 -0400 Subject: [PATCH 1/3] Fixing ScanArgsParquet include_file_paths bug (#270) Fixing ScanArgsParquet include_file_paths bug --- src/lazy/dataframe.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lazy/dataframe.rs b/src/lazy/dataframe.rs index f7c2c538a..b1e127915 100644 --- a/src/lazy/dataframe.rs +++ b/src/lazy/dataframe.rs @@ -779,7 +779,7 @@ pub fn scan_parquet(path: String, options: ScanParquetOptions) -> napi::Result Date: Mon, 23 Sep 2024 11:06:42 -0400 Subject: [PATCH 2/3] Fixing pivot docs and example (#273) Fixing pivot docs and example to close #272 --- polars/dataframe.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/polars/dataframe.ts b/polars/dataframe.ts index 1ba053bac..77a9aa7df 100644 --- a/polars/dataframe.ts +++ b/polars/dataframe.ts @@ -931,7 +931,7 @@ export interface DataFrame */ melt(idVars: ColumnSelection, valueVars: ColumnSelection): DataFrame; /** - * Unpivot DataFrame to long format. + * Unpivot a DataFrame from wide to long format. * ___ * * @param idVars - Columns to use as identifier variables. @@ -1029,9 +1029,15 @@ export interface DataFrame /** * Create a spreadsheet-style pivot table as a DataFrame. * - * @param values Column values to aggregate. Can be multiple columns if the *columns* arguments contains multiple columns as well - * @param options.index One or multiple keys to group by - * @param options.columns Columns whose values will be used as the header of the output DataFrame + * @param values The existing column(s) of values which will be moved under the new columns from index. If an + * aggregation is specified, these are the values on which the aggregation will be computed. + * If None, all remaining columns not specified on `on` and `index` will be used. + * At least one of `index` and `values` must be specified. + * @param options.index The column(s) that remain from the input to the output. The output DataFrame will have one row + * for each unique combination of the `index`'s values. + * If None, all remaining columns not specified on `on` and `values` will be used. At least one + * of `index` and `values` must be specified. + * @param options.on The column(s) whose values will be used as the new columns of the output DataFrame. * @param options.aggregateFunc * Any of: * - "sum" @@ -1055,7 +1061,7 @@ export interface DataFrame * ... "baz": [1, 2, 3, 4, 5, 6], * ... } * ... ); - * > df.pivot("baz", {index:"foo", columns:"bar"}); + * > df.pivot("baz", {index:"foo", on:"bar"}); * shape: (2, 4) * ┌─────┬─────┬─────┬─────┐ * │ foo ┆ A ┆ B ┆ C │ From ac4c35821e5a84249de87101b83e122e9422bb23 Mon Sep 17 00:00:00 2001 From: Jack Vial Date: Mon, 23 Sep 2024 11:07:09 -0400 Subject: [PATCH 3/3] fix: fix broken path to datatypes causing typescript compilation to fail (#275) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Bug Example Trying to build my project with `"nodejs-polars": "^0.15.0"` as a dependency gives the following error ``` node_modules/nodejs-polars/bin/series/index.d.ts:9:66 - error TS2307: Cannot find module '@polars/datatypes/datatype' or its corresponding type declarations. 9 import type { DTypeToJs, DtypeToJsName, JsToDtype, JsType } from "@polars/datatypes/datatype"; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` On inspecting the source TS files I see TS is complaining that the path doesn't exist. ![Screenshot 2024-09-21 at 11 06 33 AM](https://github.com/user-attachments/assets/e8389229-5d33-46a3-8c06-c4c1bc120571) This bug will not show up in development on this repo because the `@polars` alias is correctly defined in `tsconfig.json` but the distributed source code doesn't know anything about this path alias. # Testing - updated the path - successfully build my project - test loading a CSV file - On branch of the source code I ran `yarn build:ts` and `yarn test` and both succeeded ![Screenshot 2024-09-21 at 11 07 41 AM](https://github.com/user-attachments/assets/a7bc57ef-b7b1-4795-936e-717cd23dbb93) ![Screenshot 2024-09-21 at 11 08 18 AM](https://github.com/user-attachments/assets/abc4169d-45c2-4948-8055-89c24a5bc5d5) --- polars/series/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polars/series/index.ts b/polars/series/index.ts index 4f49fb357..fcd365999 100644 --- a/polars/series/index.ts +++ b/polars/series/index.ts @@ -25,7 +25,7 @@ import type { DtypeToJsName, JsToDtype, JsType, -} from "@polars/datatypes/datatype"; +} from "../datatypes/datatype"; const inspect = Symbol.for("nodejs.util.inspect.custom"); /**