From 67285ed0e34106f2d1796623d47351559dba7fe6 Mon Sep 17 00:00:00 2001 From: Darek Date: Tue, 9 Jul 2024 17:41:56 -0400 Subject: [PATCH] Upgrading to rs 0.41.3 (#238) Upgrading to rs-0.41.3 --- .github/workflows/docs.yaml | 2 +- .github/workflows/test-js.yaml | 4 +- Cargo.toml | 14 +- __tests__/dataframe.test.ts | 19 ++- __tests__/expr.test.ts | 13 +- __tests__/lazyframe.test.ts | 4 +- __tests__/series.test.ts | 2 +- package.json | 12 +- polars/dataframe.ts | 42 +++--- polars/lazy/dataframe.ts | 12 +- polars/lazy/expr/index.ts | 105 +++++++++++++-- polars/series/index.ts | 32 ++++- polars/types.ts | 2 +- rust-toolchain | 2 +- src/conversion.rs | 4 +- src/dataframe.rs | 35 +++-- src/lazy/dataframe.rs | 29 ++-- src/lazy/dsl.rs | 36 +++-- src/series.rs | 31 +++-- yarn.lock | 233 ++++++++++++++++++++------------- 20 files changed, 414 insertions(+), 219 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 8c6966ca..a2052669 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -14,7 +14,7 @@ jobs: - name: Install latest Rust nightly uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2024-05-14 + toolchain: nightly-2024-06-23 components: rustfmt, clippy - name: Install ghp-import uses: actions/setup-python@v5 diff --git a/.github/workflows/test-js.yaml b/.github/workflows/test-js.yaml index 23809c2e..493d6f93 100644 --- a/.github/workflows/test-js.yaml +++ b/.github/workflows/test-js.yaml @@ -20,7 +20,7 @@ jobs: - name: Install latest Rust nightly uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2024-05-14 + toolchain: nightly-2024-06-23 components: rustfmt, clippy - name: Check yarn version run: yarn --version @@ -46,7 +46,7 @@ jobs: - name: Install latest Rust nightly uses: dtolnay/rust-toolchain@stable with: - toolchain: nightly-2024-05-14 + toolchain: nightly-2024-06-23 components: rustfmt, clippy - name: Bun version uses: oven-sh/setup-bun@v1 diff --git a/Cargo.toml b/Cargo.toml index b5df388d..87259cc8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,18 +15,18 @@ crate-type = ["cdylib", "lib"] [dependencies] ahash = "0.8.11" bincode = "1.3.3" -napi = { version = "2.16.6", default-features = false, features = [ +napi = { version = "2.16.8", default-features = false, features = [ "napi8", "serde-json", ] } -napi-derive = { version = "2.16.5", default-features = false } -polars-core = { git = "https://github.com/pola-rs/polars.git", rev = "7bc70141f4dad7863a2026849522551abb274f00", default-features = false } -polars-io = { git = "https://github.com/pola-rs/polars.git", rev = "7bc70141f4dad7863a2026849522551abb274f00", default-features = false } -polars-lazy = { git = "https://github.com/pola-rs/polars.git", rev = "7bc70141f4dad7863a2026849522551abb274f00", default-features = false } +napi-derive = { version = "2.16.8", default-features = false } +polars-core = { git = "https://github.com/pola-rs/polars.git", rev = "91a423fea2dc067837db65c3608e3cbc1112a6fc", default-features = false } +polars-io = { git = "https://github.com/pola-rs/polars.git", rev = "91a423fea2dc067837db65c3608e3cbc1112a6fc", default-features = false } +polars-lazy = { git = "https://github.com/pola-rs/polars.git", rev = "91a423fea2dc067837db65c3608e3cbc1112a6fc", default-features = false } thiserror = "1" smartstring = { version = "1" } serde_json = { version = "1" } -either = "1.11.0" +either = "1.13.0" [dependencies.polars] features = [ @@ -161,7 +161,7 @@ features = [ "azure" ] git = "https://github.com/pola-rs/polars.git" -rev = "7bc70141f4dad7863a2026849522551abb274f00" +rev = "91a423fea2dc067837db65c3608e3cbc1112a6fc" [build-dependencies] napi-build = "2.1.3" diff --git a/__tests__/dataframe.test.ts b/__tests__/dataframe.test.ts index b66a1c27..f5a41d6a 100644 --- a/__tests__/dataframe.test.ts +++ b/__tests__/dataframe.test.ts @@ -1324,7 +1324,7 @@ describe("dataframe", () => { let actual = df.pivot("b", { index: "a", - columns: "a", + on: "a", aggregateFunc: "first", sortColumns: true, }); @@ -1340,7 +1340,7 @@ describe("dataframe", () => { }); actual = df.pivot(["a", "e"], { index: "b", - columns: ["c"], + on: ["b"], aggregateFunc: "first", separator: "|", maintainOrder: true, @@ -1348,10 +1348,10 @@ describe("dataframe", () => { expected = pl.DataFrame({ b: ["a", "b"], - "a|c|s": ["beep", null], - "a|c|f": [null, "bop"], - "e|c|s": ["x", null], - "e|c|f": [null, "y"], + "a|a": ["beep", null], + "a|b": [null, "bop"], + "e|a": ["x", null], + "e|b": [null, "y"], }); expect(actual).toFrameEqual(expected, true); }); @@ -1529,7 +1529,7 @@ describe("join", () => { }); expect(actual).toFrameEqual(expected); }); - test("how:outer", () => { + test("how:full", () => { const df = pl.DataFrame({ foo: [1, 2, 3], bar: [6.0, 7.0, 8.0], @@ -1542,7 +1542,7 @@ describe("join", () => { }); const actual = df.join(otherDF, { on: "ham", - how: "outer", + how: "full", }); const expected = pl.DataFrame({ foo: [1, 2, 3, null], @@ -2523,7 +2523,7 @@ describe("additional", () => { .sort("date"); let actual = df - .upsample("date", "1mo", "0ns", "groups", true) + .upsample("date", "1mo", "groups", true) .select(pl.col("*").forwardFill()); let expected = pl @@ -2548,7 +2548,6 @@ describe("additional", () => { .upsample({ timeColumn: "date", every: "1mo", - offset: "0ns", by: "groups", maintainOrder: true, }) diff --git a/__tests__/expr.test.ts b/__tests__/expr.test.ts index 7e500f27..b8521c40 100644 --- a/__tests__/expr.test.ts +++ b/__tests__/expr.test.ts @@ -917,7 +917,7 @@ describe("expr", () => { const actual = df.select(col("a").tail(3).as("tail3")); expect(actual).toFrameEqual(expected); }); - test.skip("take", () => { + test("take", () => { const df = pl.DataFrame({ a: [1, 2, 2, 3, 3, 8, null, 1] }); const expected = pl.DataFrame({ "take:array": [1, 2, 3, 8], @@ -1187,7 +1187,10 @@ describe("expr.str", () => { }); expect(actual).toFrameEqual(expected); actual = df.withColumns( - pl.col("a").replace([2, 3], [100, 200], -1, pl.Float64).alias("replaced"), + pl + .col("a") + .replaceStrict([2, 3], [100, 200], -1, pl.Float64) + .alias("replaced"), ); expected = pl.DataFrame({ a: [1, 2, 2, 3], @@ -1196,7 +1199,7 @@ describe("expr.str", () => { }); expect(actual).toFrameEqual(expected); actual = df.withColumns( - pl.col("b").replace("a", "c", "e", pl.Utf8).alias("replaced"), + pl.col("b").replaceStrict("a", "c", "e", pl.Utf8).alias("replaced"), ); expected = pl.DataFrame({ a: [1, 2, 2, 3], @@ -1207,7 +1210,7 @@ describe("expr.str", () => { actual = df.withColumns( pl .col("b") - .replace(["a", "b"], ["c", "d"], "e", pl.Utf8) + .replaceStrict(["a", "b"], ["c", "d"], "e", pl.Utf8) .alias("replaced"), ); expected = pl.DataFrame({ @@ -1220,7 +1223,7 @@ describe("expr.str", () => { actual = df.withColumns( pl .col("a") - .replace({ old: mapping, default_: -1, returnDtype: pl.Int64 }) + .replaceStrict({ old: mapping, default_: -1, returnDtype: pl.Int64 }) .alias("replaced"), ); expected = pl.DataFrame({ diff --git a/__tests__/lazyframe.test.ts b/__tests__/lazyframe.test.ts index fead1280..a09e374e 100644 --- a/__tests__/lazyframe.test.ts +++ b/__tests__/lazyframe.test.ts @@ -579,7 +579,7 @@ describe("lazyframe", () => { }); expect(actual).toFrameEqualIgnoringOrder(expected); }); - test("how:outer", () => { + test("how:full", () => { const df = pl.DataFrame({ foo: [1, 2, 3], bar: [6.0, 7.0, 8.0], @@ -597,7 +597,7 @@ describe("lazyframe", () => { .lazy() .join(otherDF, { on: "ham", - how: "outer", + how: "full", }) .collectSync(); const expected = pl.DataFrame({ diff --git a/__tests__/series.test.ts b/__tests__/series.test.ts index 28f8fcea..00f25725 100644 --- a/__tests__/series.test.ts +++ b/__tests__/series.test.ts @@ -600,7 +600,7 @@ describe("series", () => { expect(actual).toFrameEqual(expected); }); it("series:valueCounts", () => { - const actual = pl.Series("a", [1, 2, 2, 3]).valueCounts(); + const actual = pl.Series("a", [1, 2, 2, 3]).valueCounts(true); const expected = pl.DataFrame({ a: [2, 1, 3], count: [2, 1, 1], diff --git a/package.json b/package.json index 6f6f0733..7ab68645 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "build:ts": " rm -rf bin; tsc -p tsconfig.build.json", "cp:bin": "cp ./polars/*.node bin/", "format:rs": "cargo fmt", - "lint:ts:fix": "biome check --apply-unsafe {polars,__tests__} && biome format --write {polars,__tests__}", + "lint:ts:fix": "biome check --apply-unsafe {polars,__tests__} && biome format --write {polars,__tests__}", "lint:ts": "biome check {polars,__tests__} && biome format {polars,__tests__}", "lint": "yarn lint:ts && yarn format:rs", "prepublishOnly": "napi prepublish -t npm", @@ -55,17 +55,17 @@ }, "devDependencies": { "@biomejs/biome": "=1.7.3", - "@napi-rs/cli": "^2.18.3", + "@napi-rs/cli": "^2.18.4", "@types/chance": "^1.1.6", "@types/jest": "^29.5.12", - "@types/node": "^20.12.12", + "@types/node": "^20.14.9", "chance": "^1.1.11", "jest": "^29.7.0", "source-map-support": "^0.5.21", - "ts-jest": "^29.1.3", + "ts-jest": "^29.1.5", "ts-node": "^10.9.2", - "typedoc": "^0.25.13", - "typescript": "5.4.5" + "typedoc": "^0.26.3", + "typescript": "5.5.3" }, "packageManager": "yarn@3.6.1", "workspaces": [ diff --git a/polars/dataframe.ts b/polars/dataframe.ts index 78f22478..cb6c85f8 100644 --- a/polars/dataframe.ts +++ b/polars/dataframe.ts @@ -913,12 +913,21 @@ export interface DataFrame * ``` */ median(): DataFrame; + /** + * Unpivot a DataFrame from wide to long format. + * @deprecated *since 0.13.0* use {@link unpivot} + */ + melt(idVars: ColumnSelection, valueVars: ColumnSelection): DataFrame; /** * Unpivot DataFrame to long format. * ___ * * @param idVars - Columns to use as identifier variables. * @param valueVars - Values to use as value variables. + * @param variableName - Name to give to the `variable` column. Defaults to "variable" + * @param valueName - Name to give to the `value` column. Defaults to "value" + * @param streamable - Allow this node to run in the streaming engine. + If this runs in streaming, the output of the unpivot operation will not have a stable ordering. * @example * ``` * > const df1 = pl.DataFrame({ @@ -927,7 +936,7 @@ export interface DataFrame * ... 'asset_key_2': ['456'], * ... 'asset_key_3': ['abc'], * ... }); - * > df1.melt('id', ['asset_key_1', 'asset_key_2', 'asset_key_3']); + * > df1.unpivot('id', ['asset_key_1', 'asset_key_2', 'asset_key_3']); * shape: (3, 3) * ┌─────┬─────────────┬───────┐ * │ id ┆ variable ┆ value │ @@ -942,7 +951,7 @@ export interface DataFrame * └─────┴─────────────┴───────┘ * ``` */ - melt(idVars: ColumnSelection, valueVars: ColumnSelection): DataFrame; + unpivot(idVars: ColumnSelection, valueVars: ColumnSelection): DataFrame; /** * Aggregate the columns of this DataFrame to their minimum value. * ___ @@ -1051,7 +1060,7 @@ export interface DataFrame values: string | string[], options: { index: string | string[]; - columns: string | string[]; + on: string | string[]; aggregateFunc?: | "sum" | "max" @@ -1070,7 +1079,7 @@ export interface DataFrame pivot(options: { values: string | string[]; index: string | string[]; - columns: string | string[]; + on: string | string[]; aggregateFunc?: | "sum" | "max" @@ -1750,7 +1759,6 @@ export interface DataFrame @param timeColumn Time column will be used to determine a date range. Note that this column has to be sorted for the output to make sense. @param every Interval will start 'every' duration. - @param offset Change the start of the date range by this offset. @param by First group by these columns and then upsample for every group. @param maintainOrder Keep the ordering predictable. This is slower. @@ -1776,7 +1784,7 @@ export interface DataFrame .withColumn(pl.col("date").cast(pl.Date).alias("date")) .sort("date"); - >>> df.upsample({timeColumn: "date", every: "1mo", offset: "0ns", by: "groups", maintainOrder: true}) + >>> df.upsample({timeColumn: "date", every: "1mo", by: "groups", maintainOrder: true}) .select(pl.col("*").forwardFill()); shape: (7, 3) ┌────────────┬────────┬────────┐ @@ -1796,14 +1804,12 @@ shape: (7, 3) upsample( timeColumn: string, every: string, - offset?: string, by?: string | string[], maintainOrder?: boolean, ): DataFrame; upsample(opts: { timeColumn: string; every: string; - offset?: string; by?: string | string[]; maintainOrder?: boolean; }): DataFrame; @@ -2070,14 +2076,13 @@ export const _DataFrame = (_df: any): DataFrame => { by, ); }, - upsample(opts, every?, offset?, by?, maintainOrder?) { + upsample(opts, every?, by?, maintainOrder?) { let timeColumn; if (typeof opts === "string") { timeColumn = opts; } else { timeColumn = opts.timeColumn; by = opts.by; - offset = opts.offset; every = opts.every; maintainOrder = opts.maintainOrder ?? false; } @@ -2088,11 +2093,7 @@ export const _DataFrame = (_df: any): DataFrame => { by = by ?? []; } - offset = offset ?? "0ns"; - - return _DataFrame( - _df.upsample(by, timeColumn, every, offset, maintainOrder), - ); + return _DataFrame(_df.upsample(by, timeColumn, every, maintainOrder)); }, hashRows(obj: any = 0n, k1 = 1n, k2 = 2n, k3 = 3n) { if (typeof obj === "number" || typeof obj === "bigint") { @@ -2174,7 +2175,10 @@ export const _DataFrame = (_df: any): DataFrame => { return this.lazy().median().collectSync(); }, melt(ids, values) { - return wrap("melt", columnOrColumns(ids), columnOrColumns(values)); + return wrap("unpivot", columnOrColumns(ids), columnOrColumns(values)); + }, + unpivot(ids, values) { + return wrap("unpivot", columnOrColumns(ids), columnOrColumns(values)); }, min(axis = 0) { if (axis === 1) { @@ -2198,7 +2202,7 @@ export const _DataFrame = (_df: any): DataFrame => { let { values: values_, index, - columns, + on, maintainOrder = true, sortColumns = false, aggregateFunc = "first", @@ -2207,7 +2211,7 @@ export const _DataFrame = (_df: any): DataFrame => { values = values_ ?? values; values = typeof values === "string" ? [values] : values; index = typeof index === "string" ? [index] : index; - columns = typeof columns === "string" ? [columns] : columns; + on = typeof on === "string" ? [on] : on; let fn: Expr; if (Expr.isExpr(aggregateFunc)) { @@ -2234,7 +2238,7 @@ export const _DataFrame = (_df: any): DataFrame => { _df.pivotExpr( values, index, - columns, + on, fn, maintainOrder, sortColumns, diff --git a/polars/lazy/dataframe.ts b/polars/lazy/dataframe.ts index b7d7d4a4..4eb3651c 100644 --- a/polars/lazy/dataframe.ts +++ b/polars/lazy/dataframe.ts @@ -352,9 +352,11 @@ export interface LazyDataFrame extends Serialize, GroupByOps { */ median(): LazyDataFrame; /** - * @see {@link DataFrame.melt} + * @see {@link DataFrame.unpivot} + * @deprecated *since 0.13.0* use {@link unpivot} */ melt(idVars: ColumnSelection, valueVars: ColumnSelection): LazyDataFrame; + unpivot(idVars: ColumnSelection, valueVars: ColumnSelection): LazyDataFrame; /** * @see {@link DataFrame.min} */ @@ -929,7 +931,12 @@ export const _LazyDataFrame = (_ldf: any): LazyDataFrame => { }, melt(ids, values) { return _LazyDataFrame( - _ldf.melt(columnOrColumnsStrict(ids), columnOrColumnsStrict(values)), + _ldf.unpivot(columnOrColumnsStrict(ids), columnOrColumnsStrict(values)), + ); + }, + unpivot(ids, values) { + return _LazyDataFrame( + _ldf.unpivot(columnOrColumnsStrict(ids), columnOrColumnsStrict(values)), ); }, min() { @@ -1025,6 +1032,7 @@ export const _LazyDataFrame = (_ldf: any): LazyDataFrame => { }, sinkParquet(path: string, options: SinkParquetOptions = {}) { options.compression = options.compression ?? "zstd"; + options.statistics = options.statistics ?? false; _ldf.sinkParquet(path, options); }, }; diff --git a/polars/lazy/expr/index.ts b/polars/lazy/expr/index.ts index f8a6b7f4..5827a629 100644 --- a/polars/lazy/expr/index.ts +++ b/polars/lazy/expr/index.ts @@ -755,6 +755,7 @@ export interface Expr Accepts expression input. Non-expression inputs are parsed as literals. * @param returnDtype - The data type of the resulting expression. If set to `None` (default), the data type is determined automatically based on the other inputs. * @see {@link str.replace} + * @see {@link replace} * @example * Replace a single value by another value. Values that were not replaced remain unchanged. * ``` @@ -791,7 +792,7 @@ export interface Expr Specify a default to set all values that were not matched. * ``` >>> const mapping = {2: 100, 3: 200}; - >>> df.withColumns(pl.col("a").replace({ old: mapping, default_: -1, returnDtype: pl.Int64 }).alias("replaced"); + >>> df.withColumns(pl.col("a").replaceStrict({ old: mapping, default_: -1, returnDtype: pl.Int64 }).alias("replaced"); shape: (4, 2) ┌─────┬──────────┐ │ a ┆ replaced │ @@ -805,12 +806,12 @@ export interface Expr └─────┴──────────┘ * ``` Replacing by values of a different data type sets the return type based on - a combination of the `new` data type and either the original data type or the + a combination of the `new_` data type and either the original data type or the default data type if it was set. * ``` >>> const df = pl.DataFrame({"a": ["x", "y", "z"]}); >>> const mapping = {"x": 1, "y": 2, "z": 3}; - >>> df.withColumns(pl.col("a").replace({ old: mapping }).alias("replaced")); + >>> df.withColumns(pl.col("a").replaceStrict({ old: mapping }).alias("replaced")); shape: (3, 2) ┌─────┬──────────┐ │ a ┆ replaced │ @@ -821,7 +822,7 @@ export interface Expr │ y ┆ 2 │ │ z ┆ 3 │ └─────┴──────────┘ - >>> df.withColumns(pl.col("a").replace({ old: mapping, default_: None }).alias("replaced")); + >>> df.withColumns(pl.col("a").replaceStrict({ old: mapping, default_: None }).alias("replaced")); shape: (3, 2) ┌─────┬──────────┐ │ a ┆ replaced │ @@ -835,7 +836,7 @@ export interface Expr * ``` Set the `returnDtype` parameter to control the resulting data type directly. * ``` - >>> df.withColumns(pl.col("a").replace({ old: mapping, returnDtype: pl.UInt8 }).alias("replaced")); + >>> df.withColumns(pl.col("a").replaceStrict({ old: mapping, returnDtype: pl.UInt8 }).alias("replaced")); shape: (3, 2) ┌─────┬──────────┐ │ a ┆ replaced │ @@ -851,7 +852,7 @@ export interface Expr * ``` >>> const df = pl.DataFrame({"a": [1, 2, 2, 3], "b": [1.5, 2.5, 5.0, 1.0]}); >>> df.withColumns( - ... pl.col("a").replace({ + ... pl.col("a").replaceStrict({ ... old: pl.col("a").max(), ... new_: pl.col("b").sum(), ... default_: pl.col("b"), @@ -870,13 +871,13 @@ export interface Expr └─────┴─────┴──────────┘ * ``` */ - replace( + replaceStrict( old: Expr | string | number | (number | string)[], new_: Expr | string | number | (number | string)[], default_?: Expr | string | number | (number | string)[], returnDtype?: DataType, ): Expr; - replace({ + replaceStrict({ old, new_, default_, @@ -887,6 +888,76 @@ export interface Expr default_?: Expr | string | number | (number | string)[]; returnDtype?: DataType; }): Expr; + /** + * Replace the given values by different values of the same data type. + * @param old - Value or sequence of values to replace. + Accepts expression input. Sequences are parsed as Series, other non-expression inputs are parsed as literals. + * @param new_ - Value or sequence of values to replace by. + Accepts expression input. Sequences are parsed as Series, other non-expression inputs are parsed as literals. + Length must match the length of `old` or have length 1. + * @see {@link replace_strict} + * @see {@link str.replace} + * @example + * Replace a single value by another value. Values that were not replaced remain unchanged. + * ``` + >>> const df = pl.DataFrame({"a": [1, 2, 2, 3]}); + >>> df.withColumns(pl.col("a").replace(2, 100).alias("replaced")); + shape: (4, 2) + ┌─────┬──────────┐ + │ a ┆ replaced │ + │ --- ┆ --- │ + │ i64 ┆ i64 │ + ╞═════╪══════════╡ + │ 1 ┆ 1 │ + │ 2 ┆ 100 │ + │ 2 ┆ 100 │ + │ 3 ┆ 3 │ + └─────┴──────────┘ + * ``` + * Replace multiple values by passing sequences to the `old` and `new_` parameters. + * ``` + >>> df.withColumns(pl.col("a").replace([2, 3], [100, 200]).alias("replaced")); + shape: (4, 2) + ┌─────┬──────────┐ + │ a ┆ replaced │ + │ --- ┆ --- │ + │ i64 ┆ i64 │ + ╞═════╪══════════╡ + │ 1 ┆ 1 │ + │ 2 ┆ 100 │ + │ 2 ┆ 100 │ + │ 3 ┆ 200 │ + └─────┴──────────┘ + * ``` + * Passing a mapping with replacements is also supported as syntactic sugar. + Specify a default to set all values that were not matched. + * ``` + >>> const mapping = {2: 100, 3: 200}; + >>> df.withColumns(pl.col("a").replace({ old: mapping }).alias("replaced"); + shape: (4, 2) + ┌─────┬──────────┐ + │ a ┆ replaced │ + │ --- ┆ --- │ + │ i64 ┆ i64 │ + ╞═════╪══════════╡ + │ 1 ┆ -1 │ + │ 2 ┆ 100 │ + │ 2 ┆ 100 │ + │ 3 ┆ 200 │ + └─────┴──────────┘ + * ``` + */ + replace( + old: Expr | string | number | (number | string)[], + new_: Expr | string | number | (number | string)[], + ): Expr; + replace({ + old, + new_, + }: { + old: unknown | Expr | string | number | (number | string)[]; + new_?: Expr | string | number | (number | string)[]; + }): Expr; /** Reverse the arrays in the list */ reverse(): Expr; /** @@ -1565,7 +1636,21 @@ export const _Expr = (_expr: any): Expr => { return _Expr(_expr.repeatBy(e)); }, - replace(old, newValue, defaultValue, returnDtype) { + replace(old, newValue) { + let oldIn: any = old; + let newIn = newValue; + if (old && typeof old === "object" && !Array.isArray(old)) { + oldIn = Object.keys(old["old"]); + newIn = Object.values(old["old"]); + } + return _Expr( + _expr.replace( + exprToLitOrExpr(oldIn)._expr, + exprToLitOrExpr(newIn)._expr, + ), + ); + }, + replaceStrict(old, newValue, defaultValue, returnDtype) { let oldIn: any = old; let newIn = newValue; let defIn = defaultValue; @@ -1575,7 +1660,7 @@ export const _Expr = (_expr: any): Expr => { defIn = old["default_"]; } return _Expr( - _expr.replace( + _expr.replaceStrict( exprToLitOrExpr(oldIn)._expr, exprToLitOrExpr(newIn)._expr, defIn ? exprToLitOrExpr(defIn)._expr : undefined, diff --git a/polars/series/index.ts b/polars/series/index.ts index a254cf35..8faa18e7 100644 --- a/polars/series/index.ts +++ b/polars/series/index.ts @@ -991,6 +991,13 @@ export interface Series * __Count the unique values in a Series.__ * @param sort - Sort the output by count in descending order. * If set to `False` (default), the order of the output is random. + * @param parallel - Execute the computation in parallel. + .. note:: + This option should likely not be enabled in a group by context, + as the computation is already parallelized per group. + * @param name - Give the resulting count column a specific name; + if `normalize` is True defaults to "count", otherwise defaults to "proportion". + * @param normalize - If true gives relative frequencies of the unique values * ___ * @example * ``` @@ -1010,7 +1017,12 @@ export interface Series * ╰─────┴────────╯ * ``` */ - valueCounts(sort?: boolean): DataFrame; + valueCounts( + sort?: boolean, + parallel?: boolean, + name?: string, + normalize?: boolean, + ): DataFrame; /** * Where mask evaluates true, take values from self. * @@ -1780,8 +1792,22 @@ export function _Series(_s: any): Series { } return wrap("unique"); }, - valueCounts(sorted?) { - return _DataFrame(unwrap("valueCounts", sorted ?? false)); + valueCounts( + sort?: boolean, + parallel?: boolean, + name?: string, + normalize?: boolean, + ) { + name = name ?? normalize ? "proportion" : "count"; + return _DataFrame( + unwrap( + "valueCounts", + sort ?? false, + parallel ?? false, + name, + normalize ?? false, + ), + ); }, values() { return this[Symbol.iterator](); diff --git a/polars/types.ts b/polars/types.ts index 1eb8d0f6..21eaaca2 100644 --- a/polars/types.ts +++ b/polars/types.ts @@ -188,7 +188,7 @@ export type InterpolationMethod = /** * Join types */ -export type JoinType = "left" | "inner" | "outer" | "semi" | "anti" | "cross"; +export type JoinType = "left" | "inner" | "full" | "semi" | "anti" | "cross"; /** @ignore */ export type JoinBaseOptions = { diff --git a/rust-toolchain b/rust-toolchain index 6c90feb8..18d48b76 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2024-05-14 \ No newline at end of file +nightly-2024-06-23 \ No newline at end of file diff --git a/src/conversion.rs b/src/conversion.rs index 5d4415b3..1d0ee2c7 100644 --- a/src/conversion.rs +++ b/src/conversion.rs @@ -840,14 +840,14 @@ impl FromNapiValue for Wrap { let parsed = match s.as_ref() { "inner" => JoinType::Inner, "left" => JoinType::Left, - "outer" => JoinType::Outer, + "full" => JoinType::Full, "semi" => JoinType::Semi, "anti" => JoinType::Anti, "cross" => JoinType::Cross, v => return Err(Error::new( Status::InvalidArg, - format!("how must be one of {{'inner', 'left', 'outer', 'semi', 'anti', 'cross'}}, got {v}") + format!("how must be one of {{'inner', 'left', 'full', 'semi', 'anti', 'cross'}}, got {v}") )) }; Ok(Wrap(parsed)) diff --git a/src/dataframe.rs b/src/dataframe.rs index 8f44480d..f44ac4c6 100644 --- a/src/dataframe.rs +++ b/src/dataframe.rs @@ -132,7 +132,7 @@ fn mmap_reader_to_df<'a>( .with_ignore_errors(options.ignore_errors) .with_rechunk(options.rechunk) .with_chunk_size(options.chunk_size as usize) - .with_columns(options.columns.map(Arc::new)) + .with_columns(options.columns.map(|c| Arc::from(c))) .with_n_threads(options.num_threads.map(|i| i as usize)) .with_schema_overwrite(overwrite_dtype.map(Arc::new)) .with_schema(options.schema.map(|schema| Arc::new(schema.0))) @@ -188,7 +188,7 @@ pub fn read_json_lines( path_or_buffer: Either, options: ReadJsonOptions, ) -> napi::Result { - let infer_schema_length = options.infer_schema_length.unwrap_or(100) as usize; + let infer_schema_length = NonZeroUsize::new(options.infer_schema_length.unwrap_or(100) as usize); let batch_size = options .batch_size .map(|b| NonZeroUsize::try_from(b as usize).unwrap()); @@ -196,14 +196,14 @@ pub fn read_json_lines( let df = match path_or_buffer { Either::A(path) => JsonLineReader::from_path(path) .expect("unable to read file") - .infer_schema_len(Some(infer_schema_length)) + .infer_schema_len(infer_schema_length) .with_chunk_size(batch_size) .finish() .map_err(JsPolarsErr::from)?, Either::B(buf) => { let cursor = Cursor::new(buf.as_ref()); JsonLineReader::new(cursor) - .infer_schema_len(Some(infer_schema_length)) + .infer_schema_len(infer_schema_length) .with_chunk_size(batch_size) .finish() .map_err(JsPolarsErr::from)? @@ -216,7 +216,7 @@ pub fn read_json( path_or_buffer: Either, options: ReadJsonOptions, ) -> napi::Result { - let infer_schema_length = options.infer_schema_length.unwrap_or(100) as usize; + let infer_schema_length = NonZeroUsize::new(options.infer_schema_length.unwrap_or(100) as usize); let batch_size = options.batch_size.unwrap_or(10000) as usize; let batch_size = NonZeroUsize::new(batch_size).unwrap(); let format: JsonFormat = options @@ -234,7 +234,7 @@ pub fn read_json( let f = File::open(&path)?; let reader = BufReader::new(f); JsonReader::new(reader) - .infer_schema_len(Some(infer_schema_length)) + .infer_schema_len(infer_schema_length) .with_batch_size(batch_size) .with_json_format(format) .finish() @@ -243,7 +243,7 @@ pub fn read_json( Either::B(buf) => { let cursor = Cursor::new(buf.as_ref()); JsonReader::new(cursor) - .infer_schema_len(Some(infer_schema_length)) + .infer_schema_len(infer_schema_length) .with_batch_size(batch_size) .with_json_format(format) .finish() @@ -581,7 +581,7 @@ impl JsDataFrame { let how = match how.as_ref() { "left" => JoinType::Left, "inner" => JoinType::Inner, - "outer" => JoinType::Outer, + "full" => JoinType::Full, "semi" => JoinType::Semi, "anti" => JoinType::Anti, "asof" => JoinType::AsOf(AsOfOptions { @@ -907,7 +907,7 @@ impl JsDataFrame { fun( &self.df, index, - columns, + Some(columns), Some(values), sort_columns, aggregate_expr.map(|e| e.0 as Expr), @@ -921,7 +921,7 @@ impl JsDataFrame { JsDataFrame::new(self.df.clone()) } #[napi(catch_unwind)] - pub fn melt( + pub fn unpivot( &self, id_vars: Vec, value_vars: Vec, @@ -929,15 +929,15 @@ impl JsDataFrame { variable_name: Option, streamable: Option, ) -> napi::Result { - let args = MeltArgs { - id_vars: strings_to_smartstrings(id_vars), - value_vars: strings_to_smartstrings(value_vars), + let args = UnpivotArgs { + index: strings_to_smartstrings(id_vars), + on: strings_to_smartstrings(value_vars), value_name: value_name.map(|s| s.into()), variable_name: variable_name.map(|s| s.into()), streamable: streamable.unwrap_or(false), }; - let df = self.df.melt2(args).map_err(JsPolarsErr::from)?; + let df = self.df.unpivot2(args).map_err(JsPolarsErr::from)?; Ok(JsDataFrame::new(df)) } @@ -1110,22 +1110,19 @@ impl JsDataFrame { by: Vec, index_column: String, every: String, - offset: String, stable: bool, ) -> napi::Result { let out = if stable { self.df.upsample_stable( by, &index_column, - Duration::parse(&every), - Duration::parse(&offset), + Duration::parse(&every) ) } else { self.df.upsample( by, &index_column, - Duration::parse(&every), - Duration::parse(&offset), + Duration::parse(&every) ) }; let out = out.map_err(JsPolarsErr::from)?; diff --git a/src/lazy/dataframe.rs b/src/lazy/dataframe.rs index 5bf0dd8e..eb8b9cb5 100644 --- a/src/lazy/dataframe.rs +++ b/src/lazy/dataframe.rs @@ -228,7 +228,6 @@ impl JsLazyFrame { offset: String, closed: Wrap, by: Vec<&JsExpr>, - check_sorted: bool, ) -> JsLazyGroupBy { let closed_window = closed.0; let ldf = self.ldf.clone(); @@ -240,8 +239,7 @@ impl JsLazyFrame { index_column: "".into(), period: Duration::parse(&period), offset: Duration::parse(&offset), - closed_window, - check_sorted, + closed_window }, ); @@ -260,7 +258,6 @@ impl JsLazyFrame { closed: Wrap, by: Vec<&JsExpr>, start_by: Wrap, - check_sorted: bool, ) -> JsLazyGroupBy { let closed_window = closed.0; let by = by.to_exprs(); @@ -276,7 +273,6 @@ impl JsLazyFrame { include_boundaries, closed_window, start_by: start_by.0, - check_sorted, ..Default::default() }, ); @@ -495,7 +491,7 @@ impl JsLazyFrame { ldf.tail(n).into() } #[napi(catch_unwind)] - pub fn melt( + pub fn unpivot( &self, id_vars: Vec<&str>, value_vars: Vec<&str>, @@ -503,15 +499,15 @@ impl JsLazyFrame { variable_name: Option<&str>, streamable: Option, ) -> JsLazyFrame { - let args = MeltArgs { - id_vars: strings_to_smartstrings(id_vars), - value_vars: strings_to_smartstrings(value_vars), + let args = UnpivotArgs { + index: strings_to_smartstrings(id_vars), + on: strings_to_smartstrings(value_vars), value_name: value_name.map(|s| s.into()), variable_name: variable_name.map(|s| s.into()), streamable: streamable.unwrap_or(false), }; let ldf = self.ldf.clone(); - ldf.melt(args).into() + ldf.unpivot(args).into() } #[napi(catch_unwind)] @@ -531,7 +527,7 @@ impl JsLazyFrame { } #[napi(getter, js_name = "columns", catch_unwind)] - pub fn columns(&self) -> napi::Result> { + pub fn columns(&mut self) -> napi::Result> { Ok(self .ldf .schema() @@ -548,7 +544,6 @@ impl JsLazyFrame { #[napi(catch_unwind)] pub fn sink_csv(&self, path: String, options: SinkCsvOptions) -> napi::Result<()> { - let quote_style = QuoteStyle::default(); let null_value = options .null_value .unwrap_or(SerializeOptions::default().null); @@ -569,7 +564,7 @@ impl JsLazyFrame { quote_char, null: null_value, line_terminator, - quote_style, + ..SerializeOptions::default() }; let batch_size = options.batch_size.map(|bs| bs).unwrap_or(1024) as usize; @@ -596,7 +591,11 @@ impl JsLazyFrame { pub fn sink_parquet(&self, path: String, options: SinkParquetOptions) -> napi::Result<()> { let compression_str = options.compression.unwrap_or("zstd".to_string()); let compression = parse_parquet_compression(compression_str, options.compression_level)?; - let statistics = options.statistics.unwrap_or(false); + let statistics = if options.statistics.expect("Expect statistics") { + StatisticsOptions::full() + } else { + StatisticsOptions::empty() + }; let row_group_size = options.row_group_size.map(|i| i as usize); let data_pagesize_limit = options.data_pagesize_limit.map(|i| i as usize); let maintain_order = options.maintain_order.unwrap_or(true); @@ -756,7 +755,7 @@ pub fn scan_parquet(path: String, options: ScanParquetOptions) -> napi::Result JsExpr { + pub fn value_counts(&self, sort: bool, parallel: bool, name: String, normalize: bool) -> JsExpr { self.inner .clone() - .value_counts(multithreaded, sorted) + .value_counts(sort, parallel, name, normalize) .into() } @@ -330,7 +330,7 @@ impl JsExpr { } #[napi(catch_unwind)] pub fn gather(&self, idx: &JsExpr) -> JsExpr { - self.clone().inner.gather(idx.inner.clone()).into() + self.clone().inner.gather(idx.inner.clone().cast(DataType::Int64)).into() } #[napi(catch_unwind)] pub fn sort_by(&self, by: Vec<&JsExpr>, reverse: Vec) -> JsExpr { @@ -338,7 +338,7 @@ impl JsExpr { .inner .sort_by( by.to_exprs(), - SortMultipleOptions::default().with_order_descendings(reverse), + SortMultipleOptions::default().with_order_descending_multi(reverse), ) .into() } @@ -462,7 +462,7 @@ impl JsExpr { pub fn slice(&self, offset: &JsExpr, length: &JsExpr) -> JsExpr { self.inner .clone() - .slice(offset.inner.clone(), length.inner.clone()) + .slice(offset.inner.clone().cast(DataType::Int64), length.inner.clone().cast(DataType::Int64)) .into() } #[napi(catch_unwind)] @@ -956,6 +956,20 @@ impl JsExpr { } #[napi(catch_unwind)] pub fn replace( + &self, + old: &JsExpr, + new: &JsExpr + ) -> JsExpr { + self.inner + .clone() + .replace( + old.inner.clone(), + new.inner.clone() + ) + .into() + } + #[napi(catch_unwind)] + pub fn replace_strict( &self, old: &JsExpr, new: &JsExpr, @@ -964,7 +978,7 @@ impl JsExpr { ) -> JsExpr { self.inner .clone() - .replace( + .replace_strict( old.inner.clone(), new.inner.clone(), default.map(|e| e.inner.clone()), @@ -1365,11 +1379,11 @@ impl JsExpr { self.inner.clone().kurtosis(fisher, bias).into() } #[napi(catch_unwind)] - pub fn str_concat(&self, delimiter: String, ignore_nulls: bool) -> JsExpr { + pub fn str_concat(&self, separator: String, ignore_nulls: bool) -> JsExpr { self.inner .clone() .str() - .concat(&delimiter, ignore_nulls) + .join(&separator, ignore_nulls) .into() } #[napi(catch_unwind)] @@ -1387,7 +1401,7 @@ impl JsExpr { } #[napi(catch_unwind)] pub fn reshape(&self, dims: Vec) -> JsExpr { - self.inner.clone().reshape(&dims).into() + self.inner.clone().reshape(&dims, NestedType::Array).into() } #[napi(catch_unwind)] pub fn cum_count(&self, reverse: bool) -> JsExpr { @@ -1399,7 +1413,7 @@ impl JsExpr { .clone() .map( |s| Ok(Some(s.to_physical_repr().into_owned())), - GetOutput::map_dtype(|dt| dt.to_physical()), + GetOutput::map_dtype(|dt| Ok(dt.to_physical())), ) .with_fmt("to_physical") .into() @@ -1711,7 +1725,7 @@ pub fn arg_sort_by(by: Vec<&JsExpr>, descending: Vec) -> JsExpr { let by = by.to_exprs(); polars::lazy::dsl::arg_sort_by( by, - SortMultipleOptions::default().with_order_descendings(descending), + SortMultipleOptions::default().with_order_descending_multi(descending), ) .into() } diff --git a/src/series.rs b/src/series.rs index be4851e7..1201d375 100644 --- a/src/series.rs +++ b/src/series.rs @@ -477,24 +477,29 @@ impl JsSeries { } } #[napi(catch_unwind)] - pub fn add(&self, other: &JsSeries) -> JsSeries { - (&self.series + &other.series).into() + pub fn add(&self, other: &JsSeries) -> napi::Result { + let series = (&self.series + &other.series).map_err(JsPolarsErr::from)?; + Ok(JsSeries { series }) } #[napi(catch_unwind)] - pub fn sub(&self, other: &JsSeries) -> JsSeries { - (&self.series - &other.series).into() + pub fn sub(&self, other: &JsSeries) -> napi::Result { + let series = (&self.series - &other.series).map_err(JsPolarsErr::from)?; + Ok(JsSeries { series }) } #[napi(catch_unwind)] - pub fn mul(&self, other: &JsSeries) -> JsSeries { - (&self.series * &other.series).into() + pub fn mul(&self, other: &JsSeries) -> napi::Result { + let series = (&self.series * &other.series).map_err(JsPolarsErr::from)?; + Ok(JsSeries { series }) } #[napi(catch_unwind)] - pub fn div(&self, other: &JsSeries) -> JsSeries { - (&self.series / &other.series).into() + pub fn div(&self, other: &JsSeries) -> napi::Result { + let series = (&self.series / &other.series).map_err(JsPolarsErr::from)?; + Ok(JsSeries { series }) } #[napi(catch_unwind)] - pub fn rem(&self, other: &JsSeries) -> JsSeries { - (&self.series % &other.series).into() + pub fn rem(&self, other: &JsSeries) -> napi::Result { + let series = (&self.series % &other.series).map_err(JsPolarsErr::from)?; + Ok(JsSeries { series }) } #[napi(catch_unwind)] pub fn head(&self, length: Option) -> JsSeries { @@ -547,10 +552,10 @@ impl JsSeries { Ok(unique.into()) } #[napi(catch_unwind)] - pub fn value_counts(&self, sorted: bool) -> napi::Result { + pub fn value_counts(&self, sort: bool, parallel: bool, name: String, normalize: bool) -> napi::Result { let df = self .series - .value_counts(true, sorted) + .value_counts(sort, parallel, name, normalize) .map_err(JsPolarsErr::from)?; Ok(df.into()) } @@ -1204,7 +1209,7 @@ impl JsSeries { #[napi(catch_unwind)] pub fn reshape(&self, dims: Vec) -> napi::Result { - let out = self.series.reshape(&dims).map_err(JsPolarsErr::from)?; + let out = self.series.reshape_list(&dims).map_err(JsPolarsErr::from)?; Ok(out.into()) } diff --git a/yarn.lock b/yarn.lock index 8f147f2a..691e2cbb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -412,14 +412,14 @@ __metadata: version: 1.7.3 resolution: "@biomejs/biome@npm:1.7.3" dependencies: - "@biomejs/cli-darwin-arm64": "npm:1.7.3" - "@biomejs/cli-darwin-x64": "npm:1.7.3" - "@biomejs/cli-linux-arm64": "npm:1.7.3" - "@biomejs/cli-linux-arm64-musl": "npm:1.7.3" - "@biomejs/cli-linux-x64": "npm:1.7.3" - "@biomejs/cli-linux-x64-musl": "npm:1.7.3" - "@biomejs/cli-win32-arm64": "npm:1.7.3" - "@biomejs/cli-win32-x64": "npm:1.7.3" + "@biomejs/cli-darwin-arm64": 1.7.3 + "@biomejs/cli-darwin-x64": 1.7.3 + "@biomejs/cli-linux-arm64": 1.7.3 + "@biomejs/cli-linux-arm64-musl": 1.7.3 + "@biomejs/cli-linux-x64": 1.7.3 + "@biomejs/cli-linux-x64-musl": 1.7.3 + "@biomejs/cli-win32-arm64": 1.7.3 + "@biomejs/cli-win32-x64": 1.7.3 dependenciesMeta: "@biomejs/cli-darwin-arm64": optional: true @@ -824,12 +824,12 @@ __metadata: languageName: node linkType: hard -"@napi-rs/cli@npm:^2.18.3": - version: 2.18.3 - resolution: "@napi-rs/cli@npm:2.18.3" +"@napi-rs/cli@npm:^2.18.4": + version: 2.18.4 + resolution: "@napi-rs/cli@npm:2.18.4" bin: napi: scripts/index.js - checksum: d94470b37fd6305f94d82c58b3f1c643b60be14b6b053e30cc2ade426da58b5eb11e9efd78a576cecc0fab4d9ac8153e20b99fbab587db86ca14f75872927cf8 + checksum: f243e5c822a4a9103fba49193eda2023cb08c1ef9c0b521d8a0ece860ef13f9f2b4d5ac106c3d9e5792d22ed2196213e336cf59d9c2ee81241ac4b4b8ca6ea30 languageName: node linkType: hard @@ -862,6 +862,13 @@ __metadata: languageName: node linkType: hard +"@shikijs/core@npm:1.10.1": + version: 1.10.1 + resolution: "@shikijs/core@npm:1.10.1" + checksum: b2aa039c05b46347d169118c6fe6ec3390ad70f1dc74e1ec46210c1caf4540976ca0d23a7d5c2a0114dff862b3bae5f6c215f95c052f4395d4cc6f96d194b8e9 + languageName: node + linkType: hard + "@sinclair/typebox@npm:^0.27.8": version: 0.27.8 resolution: "@sinclair/typebox@npm:0.27.8" @@ -1007,7 +1014,7 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:*, @types/node@npm:^20.12.12": +"@types/node@npm:*": version: 20.14.1 resolution: "@types/node@npm:20.14.1" dependencies: @@ -1016,6 +1023,15 @@ __metadata: languageName: node linkType: hard +"@types/node@npm:^20.14.9": + version: 20.14.9 + resolution: "@types/node@npm:20.14.9" + dependencies: + undici-types: ~5.26.4 + checksum: 5e9eda1ac8c6cc6bcd1063903ae195eaede9aad1bdad00408a919409cfbcdd2d6535aa3d50346f0d385528f9e03dafc7d1b3bad25aedb1dcd79a6ad39d06c35d + languageName: node + linkType: hard + "@types/stack-utils@npm:^2.0.0": version: 2.0.3 resolution: "@types/stack-utils@npm:2.0.3" @@ -1104,13 +1120,6 @@ __metadata: languageName: node linkType: hard -"ansi-sequence-parser@npm:^1.1.0": - version: 1.1.1 - resolution: "ansi-sequence-parser@npm:1.1.1" - checksum: ead5b15c596e8e85ca02951a844366c6776769dcc9fd1bd3a0db11bb21364554822c6a439877fb599e7e1ffa0b5f039f1e5501423950457f3dcb2f480c30b188 - languageName: node - linkType: hard - "ansi-styles@npm:^3.2.1": version: 3.2.1 resolution: "ansi-styles@npm:3.2.1" @@ -1169,6 +1178,13 @@ __metadata: languageName: node linkType: hard +"argparse@npm:^2.0.1": + version: 2.0.1 + resolution: "argparse@npm:2.0.1" + checksum: 83644b56493e89a254bae05702abf3a1101b4fa4d0ca31df1c9985275a5a5bd47b3c27b7fa0b71098d41114d8ca000e6ed90cad764b306f8a503665e4d517ced + languageName: node + linkType: hard + "babel-jest@npm:^29.7.0": version: 29.7.0 resolution: "babel-jest@npm:29.7.0" @@ -1641,6 +1657,13 @@ __metadata: languageName: node linkType: hard +"entities@npm:^4.4.0": + version: 4.5.0 + resolution: "entities@npm:4.5.0" + checksum: 853f8ebd5b425d350bffa97dd6958143179a5938352ccae092c62d1267c4e392a039be1bae7d51b6e4ffad25f51f9617531fedf5237f15df302ccfb452cbf2d7 + languageName: node + linkType: hard + "env-paths@npm:^2.2.0": version: 2.2.1 resolution: "env-paths@npm:2.2.1" @@ -2665,13 +2688,6 @@ __metadata: languageName: node linkType: hard -"jsonc-parser@npm:^3.2.0": - version: 3.2.1 - resolution: "jsonc-parser@npm:3.2.1" - checksum: 656d9027b91de98d8ab91b3aa0d0a4cab7dc798a6830845ca664f3e76c82d46b973675bbe9b500fae1de37fd3e81aceacbaa2a57884bf2f8f29192150d2d1ef7 - languageName: node - linkType: hard - "kleur@npm:^3.0.3": version: 3.0.3 resolution: "kleur@npm:3.0.3" @@ -2693,6 +2709,15 @@ __metadata: languageName: node linkType: hard +"linkify-it@npm:^5.0.0": + version: 5.0.0 + resolution: "linkify-it@npm:5.0.0" + dependencies: + uc.micro: ^2.0.0 + checksum: b0b86cadaf816b64c947a83994ceaad1c15f9fe7e079776ab88699fb71afd7b8fc3fd3d0ae5ebec8c92c1d347be9ba257b8aef338c0ebf81b0d27dcf429a765a + languageName: node + linkType: hard + "locate-path@npm:^5.0.0": version: 5.0.0 resolution: "locate-path@npm:5.0.0" @@ -2784,12 +2809,26 @@ __metadata: languageName: node linkType: hard -"marked@npm:^4.3.0": - version: 4.3.0 - resolution: "marked@npm:4.3.0" +"markdown-it@npm:^14.1.0": + version: 14.1.0 + resolution: "markdown-it@npm:14.1.0" + dependencies: + argparse: ^2.0.1 + entities: ^4.4.0 + linkify-it: ^5.0.0 + mdurl: ^2.0.0 + punycode.js: ^2.3.1 + uc.micro: ^2.1.0 bin: - marked: bin/marked.js - checksum: 0db6817893952c3ec710eb9ceafb8468bf5ae38cb0f92b7b083baa13d70b19774674be04db5b817681fa7c5c6a088f61300815e4dd75a59696f4716ad69f6260 + markdown-it: bin/markdown-it.mjs + checksum: 07296b45ebd0b13a55611a24d1b1ad002c6729ec54f558f597846994b0b7b1de79d13cd99ff3e7b6e9e027f36b63125cdcf69174da294ecabdd4e6b9fff39e5d + languageName: node + linkType: hard + +"mdurl@npm:^2.0.0": + version: 2.0.0 + resolution: "mdurl@npm:2.0.0" + checksum: 880bc289ef668df0bb34c5b2b5aaa7b6ea755052108cdaf4a5e5968ad01cf27e74927334acc9ebcc50a8628b65272ae6b1fd51fae1330c130e261c0466e1a3b2 languageName: node linkType: hard @@ -2826,7 +2865,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^9.0.3, minimatch@npm:^9.0.4": +"minimatch@npm:^9.0.4": version: 9.0.4 resolution: "minimatch@npm:9.0.4" dependencies: @@ -2835,6 +2874,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:^9.0.5": + version: 9.0.5 + resolution: "minimatch@npm:9.0.5" + dependencies: + brace-expansion: ^2.0.1 + checksum: 2c035575eda1e50623c731ec6c14f65a85296268f749b9337005210bb2b34e2705f8ef1a358b188f69892286ab99dc42c8fb98a57bde55c8d81b3023c19cea28 + languageName: node + linkType: hard + "minipass-collect@npm:^2.0.1": version: 2.0.1 resolution: "minipass-collect@npm:2.0.1" @@ -2988,17 +3036,17 @@ __metadata: resolution: "nodejs-polars@workspace:." dependencies: "@biomejs/biome": =1.7.3 - "@napi-rs/cli": ^2.18.3 + "@napi-rs/cli": ^2.18.4 "@types/chance": ^1.1.6 "@types/jest": ^29.5.12 - "@types/node": ^20.12.12 + "@types/node": ^20.14.9 chance: ^1.1.11 jest: ^29.7.0 source-map-support: ^0.5.21 - ts-jest: ^29.1.3 + ts-jest: ^29.1.5 ts-node: ^10.9.2 - typedoc: ^0.25.13 - typescript: 5.4.5 + typedoc: ^0.26.3 + typescript: 5.5.3 languageName: unknown linkType: soft @@ -3215,6 +3263,13 @@ __metadata: languageName: node linkType: hard +"punycode.js@npm:^2.3.1": + version: 2.3.1 + resolution: "punycode.js@npm:2.3.1" + checksum: 13466d7ed5e8dacdab8c4cc03837e7dd14218a59a40eb14a837f1f53ca396e18ef2c4ee6d7766b8ed2fc391d6a3ac489eebf2de83b3596f5a54e86df4a251b72 + languageName: node + linkType: hard + "pure-rand@npm:^6.0.0": version: 6.1.0 resolution: "pure-rand@npm:6.1.0" @@ -3340,15 +3395,12 @@ __metadata: languageName: node linkType: hard -"shiki@npm:^0.14.7": - version: 0.14.7 - resolution: "shiki@npm:0.14.7" +"shiki@npm:^1.9.1": + version: 1.10.1 + resolution: "shiki@npm:1.10.1" dependencies: - ansi-sequence-parser: "npm:^1.1.0" - jsonc-parser: "npm:^3.2.0" - vscode-oniguruma: "npm:^1.7.0" - vscode-textmate: "npm:^8.0.0" - checksum: 2aec3b3519df977c4391df9e1825cb496e9a4d7e11395f05a0da77e4fa2f7c3d9d6e6ee94029ac699533017f2b25637ee68f6d39f05f311535c2704d0329b520 + "@shikijs/core": 1.10.1 + checksum: 54f4da715ca981168805ad11728da0dcf3808e488ac79974d8e0096f86c841aaeb9018e4d78ccba3e71bc067be482f8fa5ccb2c82d77df970f8b784a8cb9d9a8 languageName: node linkType: hard @@ -3620,18 +3672,18 @@ __metadata: languageName: node linkType: hard -"ts-jest@npm:^29.1.3": - version: 29.1.4 - resolution: "ts-jest@npm:29.1.4" +"ts-jest@npm:^29.1.5": + version: 29.1.5 + resolution: "ts-jest@npm:29.1.5" dependencies: - bs-logger: "npm:0.x" - fast-json-stable-stringify: "npm:2.x" - jest-util: "npm:^29.0.0" - json5: "npm:^2.2.3" - lodash.memoize: "npm:4.x" - make-error: "npm:1.x" - semver: "npm:^7.5.3" - yargs-parser: "npm:^21.0.1" + bs-logger: 0.x + fast-json-stable-stringify: 2.x + jest-util: ^29.0.0 + json5: ^2.2.3 + lodash.memoize: 4.x + make-error: 1.x + semver: ^7.5.3 + yargs-parser: ^21.0.1 peerDependencies: "@babel/core": ">=7.0.0-beta.0 <8" "@jest/transform": ^29.0.0 @@ -3652,7 +3704,7 @@ __metadata: optional: true bin: ts-jest: cli.js - checksum: e36cba389adbb3700b46422e883c8d25e76febcc01c4a39c801ef15e6edbd6da1695bdd144100153e992f98a754aea4099906955b1b9a83c3c72d77009c3d7e2 + checksum: 96bfdea46d7faa83457c2647806a31a86f28656f703515fee9f6d2ff1ccfc58ccfbbe3ae9283f40141a85af0def30afe887843be5b002c08ed5d5189c941eab1 languageName: node linkType: hard @@ -3708,39 +3760,47 @@ __metadata: languageName: node linkType: hard -"typedoc@npm:^0.25.13": - version: 0.25.13 - resolution: "typedoc@npm:0.25.13" +"typedoc@npm:^0.26.3": + version: 0.26.3 + resolution: "typedoc@npm:0.26.3" dependencies: - lunr: "npm:^2.3.9" - marked: "npm:^4.3.0" - minimatch: "npm:^9.0.3" - shiki: "npm:^0.14.7" + lunr: ^2.3.9 + markdown-it: ^14.1.0 + minimatch: ^9.0.5 + shiki: ^1.9.1 + yaml: ^2.4.5 peerDependencies: - typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x + typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x bin: typedoc: bin/typedoc - checksum: 703d1f48137300b0ef3df1998a25ae745db3ca0b126f8dd1f7262918f11243a94d24dfc916cdba2baeb5a7d85d5a94faac811caf7f4fa6b7d07144dc02f7639f + checksum: 3e4fc7cbd455e2adf591b4d01f191fa9518e56a4a2ee659ba1d4d221902656dc1f3572a726443b91bb3586bb485e783d924670f7a9087602153ef04ea2dcbd82 languageName: node linkType: hard -"typescript@npm:5.4.5": - version: 5.4.5 - resolution: "typescript@npm:5.4.5" +"typescript@npm:5.5.3": + version: 5.5.3 + resolution: "typescript@npm:5.5.3" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 53c879c6fa1e3bcb194b274d4501ba1985894b2c2692fa079db03c5a5a7140587a1e04e1ba03184605d35f439b40192d9e138eb3279ca8eee313c081c8bcd9b0 + checksum: 4b4f14313484d5c86064d04ba892544801fa551f5cf72719b540b498056fec7fc192d0bbdb2ba1448e759b1548769956da9e43e7c16781e8d8856787b0575004 languageName: node linkType: hard -"typescript@patch:typescript@5.4.5#~builtin": - version: 5.4.5 - resolution: "typescript@patch:typescript@npm%3A5.4.5#~builtin::version=5.4.5&hash=14eedb" +"typescript@patch:typescript@5.5.3#~builtin": + version: 5.5.3 + resolution: "typescript@patch:typescript@npm%3A5.5.3#~builtin::version=5.5.3&hash=14eedb" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 2373c693f3b328f3b2387c3efafe6d257b057a142f9a79291854b14ff4d5367d3d730810aee981726b677ae0fd8329b23309da3b6aaab8263dbdccf1da07a3ba + checksum: 6853be4607706cc1ad2f16047cf1cd72d39f79acd5f9716e1d23bc0e462c7f59be7458fe58a21665e7657a05433d7ab8419d093a5a4bd5f3a33f879b35d2769b + languageName: node + linkType: hard + +"uc.micro@npm:^2.0.0, uc.micro@npm:^2.1.0": + version: 2.1.0 + resolution: "uc.micro@npm:2.1.0" + checksum: 37197358242eb9afe367502d4638ac8c5838b78792ab218eafe48287b0ed28aaca268ec0392cc5729f6c90266744de32c06ae938549aee041fc93b0f9672d6b2 languageName: node linkType: hard @@ -3801,20 +3861,6 @@ __metadata: languageName: node linkType: hard -"vscode-oniguruma@npm:^1.7.0": - version: 1.7.0 - resolution: "vscode-oniguruma@npm:1.7.0" - checksum: 53519d91d90593e6fb080260892e87d447e9b200c4964d766772b5053f5699066539d92100f77f1302c91e8fc5d9c772fbe40fe4c90f3d411a96d5a9b1e63f42 - languageName: node - linkType: hard - -"vscode-textmate@npm:^8.0.0": - version: 8.0.0 - resolution: "vscode-textmate@npm:8.0.0" - checksum: 127780dfea89559d70b8326df6ec344cfd701312dd7f3f591a718693812b7852c30b6715e3cfc8b3200a4e2515b4c96f0843c0eacc0a3020969b5de262c2a4bb - languageName: node - linkType: hard - "walker@npm:^1.0.8": version: 1.0.8 resolution: "walker@npm:1.0.8" @@ -3906,6 +3952,15 @@ __metadata: languageName: node linkType: hard +"yaml@npm:^2.4.5": + version: 2.4.5 + resolution: "yaml@npm:2.4.5" + bin: + yaml: bin.mjs + checksum: f8efd407c07e095f00f3031108c9960b2b12971d10162b1ec19007200f6c987d2e28f73283f4731119aa610f177a3ea03d4a8fcf640600a25de1b74d00c69b3d + languageName: node + linkType: hard + "yargs-parser@npm:^21.0.1, yargs-parser@npm:^21.1.1": version: 21.1.1 resolution: "yargs-parser@npm:21.1.1"