Skip to content

Commit 2c0e091

Browse files
authored
Updating to rs-0.45 (#301)
Updating to rs-0.45
1 parent 8816b46 commit 2c0e091

21 files changed

+1245
-1537
lines changed

.github/workflows/docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Install latest Rust nightly
1515
uses: dtolnay/rust-toolchain@stable
1616
with:
17-
toolchain: nightly-2024-10-28
17+
toolchain: nightly-2024-11-28
1818
components: rustfmt, clippy
1919
- name: Install ghp-import
2020
uses: actions/setup-python@v5

.github/workflows/test-js.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Install latest Rust nightly
2121
uses: dtolnay/rust-toolchain@stable
2222
with:
23-
toolchain: nightly-2024-10-28
23+
toolchain: nightly-2024-11-28
2424
components: rustfmt, clippy
2525
- name: Check yarn version
2626
run: yarn --version
@@ -46,7 +46,7 @@ jobs:
4646
- name: Install latest Rust nightly
4747
uses: dtolnay/rust-toolchain@stable
4848
with:
49-
toolchain: nightly-2024-10-28
49+
toolchain: nightly-2024-11-28
5050
components: rustfmt, clippy
5151
- name: Bun version
5252
uses: oven-sh/setup-bun@v1

.yarn/releases/yarn-4.5.0.cjs

Lines changed: 0 additions & 925 deletions
This file was deleted.

.yarn/releases/yarn-4.5.3.cjs

Lines changed: 934 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ enableGlobalCache: false
44

55
nodeLinker: node-modules
66

7-
yarnPath: .yarn/releases/yarn-4.5.0.cjs
7+
yarnPath: .yarn/releases/yarn-4.5.3.cjs

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ napi = { version = "2.16.13", default-features = false, features = [
1919
"napi8",
2020
"serde-json",
2121
] }
22-
napi-derive = { version = "2.16.12", default-features = false }
23-
polars-core = { git = "https://github.com/pola-rs/polars.git", rev = "2dce3d3b5c80ae7522a3435f844fac8fed9dc9e8", default-features = false }
24-
polars-io = { git = "https://github.com/pola-rs/polars.git", rev = "2dce3d3b5c80ae7522a3435f844fac8fed9dc9e8", default-features = false }
25-
polars-lazy = { git = "https://github.com/pola-rs/polars.git", rev = "2dce3d3b5c80ae7522a3435f844fac8fed9dc9e8", default-features = false }
22+
napi-derive = { version = "2.16.13", default-features = false }
23+
polars-core = { git = "https://github.com/pola-rs/polars.git", rev = "58a38af21dccaf3326514494a1db118601c8c2ca", default-features = false }
24+
polars-io = { git = "https://github.com/pola-rs/polars.git", rev = "58a38af21dccaf3326514494a1db118601c8c2ca", default-features = false }
25+
polars-lazy = { git = "https://github.com/pola-rs/polars.git", rev = "58a38af21dccaf3326514494a1db118601c8c2ca", default-features = false }
2626
thiserror = "1"
2727
smartstring = { version = "1" }
2828
serde_json = { version = "1" }
2929
either = "1.13.0"
30-
hashbrown = { version = "0.15.0", features = ["rayon", "serde"] }
30+
hashbrown = { version = "0.15.2", features = ["rayon", "serde"] }
3131

3232
[dependencies.polars]
3333
features = [
@@ -162,7 +162,7 @@ features = [
162162
"azure"
163163
]
164164
git = "https://github.com/pola-rs/polars.git"
165-
rev = "2dce3d3b5c80ae7522a3435f844fac8fed9dc9e8"
165+
rev = "58a38af21dccaf3326514494a1db118601c8c2ca"
166166

167167
[build-dependencies]
168168
napi-build = "2.1.3"

__tests__/dataframe.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,7 +1680,7 @@ describe("io", () => {
16801680
expect(actual).toEqual(expected);
16811681
});
16821682
test("writeCSV:string:sep", () => {
1683-
const actual = df.clone().writeCSV({ sep: "X" }).toString();
1683+
const actual = df.clone().writeCSV({ separator: "X" }).toString();
16841684
const expected = "fooXbar\n1X6\n2X2\n9X8\n";
16851685
expect(actual).toEqual(expected);
16861686
});
@@ -1689,14 +1689,14 @@ describe("io", () => {
16891689
bar: ["a,b,c", "d,e,f", "g,h,i"],
16901690
foo: [1, 2, 3],
16911691
});
1692-
const actual = df.writeCSV({ quote: "^" }).toString();
1692+
const actual = df.writeCSV({ quoteChar: "^" }).toString();
16931693
const expected = "bar,foo\n^a,b,c^,1.0\n^d,e,f^,2.0\n^g,h,i^,3.0\n";
16941694
expect(actual).toEqual(expected);
16951695
});
16961696
test("writeCSV:string:header", () => {
16971697
const actual = df
16981698
.clone()
1699-
.writeCSV({ sep: "X", includeHeader: false, lineTerminator: "|" })
1699+
.writeCSV({ separator: "X", includeHeader: false, lineTerminator: "|" })
17001700
.toString();
17011701
const expected = "1X6|2X2|9X8|";
17021702
expect(actual).toEqual(expected);

__tests__/io.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,21 @@ describe("read:csv", () => {
5252
csvString.slice(0, 22),
5353
);
5454
});
55+
it("can read from a csv buffer with newline in the header", () => {
56+
const csvBuffer = Buffer.from(
57+
'"name\na","height\nb"\n"John",172.23\n"Anna",1653.34',
58+
);
59+
const df = pl.readCSV(csvBuffer, {
60+
quoteChar: '"',
61+
sep: ",",
62+
hasHeader: false,
63+
skipRows: 1,
64+
});
65+
expect(df.toRecords()).toEqual([
66+
{ column_1: "John", column_2: 172.23 },
67+
{ column_1: "Anna", column_2: 1653.34 },
68+
]);
69+
});
5570
it("can read from a csv buffer", () => {
5671
const csvBuffer = Buffer.from("foo,bar,baz\n1,2,3\n4,5,6\n", "utf-8");
5772
const df = pl.readCSV(csvBuffer);

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,16 @@
5858
"@napi-rs/cli": "^2.18.4",
5959
"@types/chance": "^1.1.6",
6060
"@types/jest": "^29.5.14",
61-
"@types/node": "^22.8.6",
61+
"@types/node": "^22.10.1",
6262
"chance": "^1.1.12",
6363
"jest": "^29.7.0",
6464
"source-map-support": "^0.5.21",
6565
"ts-jest": "^29.2.5",
6666
"ts-node": "^10.9.2",
67-
"typedoc": "^0.26.10",
68-
"typescript": "5.6.3"
67+
"typedoc": "^0.27.3",
68+
"typescript": "5.7.2"
6969
},
70-
"packageManager": "[email protected].0",
70+
"packageManager": "[email protected].3",
7171
"workspaces": [
7272
"benches"
7373
]

polars/dataframe.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import { type LazyDataFrame, _LazyDataFrame } from "./lazy/dataframe";
1212
import { Expr } from "./lazy/expr";
1313
import { Series, _Series } from "./series";
1414
import type {
15+
CsvWriterOptions,
1516
FillNullStrategy,
1617
JoinOptions,
1718
WriteAvroOptions,
18-
WriteCsvOptions,
1919
WriteIPCOptions,
2020
WriteParquetOptions,
2121
} from "./types";
@@ -61,8 +61,8 @@ interface WriteMethods {
6161
* @param options.includeBom - Whether to include UTF-8 BOM in the CSV output.
6262
* @param options.lineTerminator - String used to end each row.
6363
* @param options.includeHeader - Whether or not to include header in the CSV output.
64-
* @param options.sep - Separate CSV fields with this symbol. _defaults to `,`
65-
* @param options.quote - Character to use for quoting. Default: \" Note: it will note be used when sep is used
64+
* @param options.separator - Separate CSV fields with this symbol. _defaults to `,`
65+
* @param options.quoteChar - Character to use for quoting. Default: \" Note: it will note be used when sep is used
6666
* @param options.batchSize - Number of rows that will be processed per thread.
6767
* @param options.datetimeFormat - A format string, with the specifiers defined by the
6868
* `chrono <https://docs.rs/chrono/latest/chrono/format/strftime/index.html>`_
@@ -109,8 +109,8 @@ interface WriteMethods {
109109
* @category IO
110110
*/
111111
writeCSV(): Buffer;
112-
writeCSV(options: WriteCsvOptions): Buffer;
113-
writeCSV(dest: string | Writable, options?: WriteCsvOptions): void;
112+
writeCSV(options: CsvWriterOptions): Buffer;
113+
writeCSV(dest: string | Writable, options?: CsvWriterOptions): void;
114114
/**
115115
* Write Dataframe to JSON string, file, or write stream
116116
* @param destination file or write stream

0 commit comments

Comments
 (0)