diff --git a/arrow/package.json b/arrow/package.json index 343de027..4ae79915 100644 --- a/arrow/package.json +++ b/arrow/package.json @@ -27,7 +27,7 @@ "@dpkit/file": "workspace:*", "@dpkit/table": "workspace:*", "csv-sniffer": "^0.1.1", - "nodejs-polars": "^0.21.1" + "nodejs-polars": "^0.21.2" }, "devDependencies": { "@dpkit/test": "workspace:*" diff --git a/csv/package.json b/csv/package.json index 108f5db3..66573236 100644 --- a/csv/package.json +++ b/csv/package.json @@ -27,7 +27,7 @@ "@dpkit/file": "workspace:*", "@dpkit/table": "workspace:*", "csv-sniffer": "^0.1.1", - "nodejs-polars": "^0.21.1" + "nodejs-polars": "^0.21.2" }, "devDependencies": { "@dpkit/test": "workspace:*" diff --git a/database/package.json b/database/package.json index 13a73dcc..2e7fad73 100644 --- a/database/package.json +++ b/database/package.json @@ -29,7 +29,7 @@ "libsql": "^0.6.0-pre.20", "lru-cache": "^11.2.1", "mysql2": "^3.14.4", - "nodejs-polars": "^0.21.1", + "nodejs-polars": "^0.21.2", "pg": "^8.16.3" }, "devDependencies": { diff --git a/docs/package.json b/docs/package.json index 618d2760..a4853126 100644 --- a/docs/package.json +++ b/docs/package.json @@ -12,7 +12,7 @@ "@astrojs/starlight": "0.35.2", "@dpkit/all": "workspace:*", "astro": "5.12.9", - "nodejs-polars": "0.21.1", + "nodejs-polars": "0.21.2", "sharp": "0.34.2", "starlight-changelogs": "0.1.1", "starlight-scroll-to-top": "0.3.1", diff --git a/dpkit/package.json b/dpkit/package.json index c364a96b..fa730887 100644 --- a/dpkit/package.json +++ b/dpkit/package.json @@ -37,7 +37,7 @@ "es-toolkit": "^1.39.10", "exit-hook": "^4.0.0", "ink": "^6.3.1", - "nodejs-polars": "^0.21.0", + "nodejs-polars": "^0.21.2", "picocolors": "^1.1.1", "react": "^19.1.1", "react-devtools-core": "^6.1.2", diff --git a/inline/package.json b/inline/package.json index 2f211fbe..72e74186 100644 --- a/inline/package.json +++ b/inline/package.json @@ -23,7 +23,7 @@ "build": "tsc" }, "dependencies": { - "nodejs-polars": "^0.21.1", + "nodejs-polars": "^0.21.2", "@dpkit/core": "workspace:*", "@dpkit/table": "workspace:*" } diff --git a/json/package.json b/json/package.json index 58325c15..1c7e031f 100644 --- a/json/package.json +++ b/json/package.json @@ -27,7 +27,7 @@ "@dpkit/file": "workspace:*", "@dpkit/table": "workspace:*", "csv-sniffer": "^0.1.1", - "nodejs-polars": "^0.21.1" + "nodejs-polars": "^0.21.2" }, "devDependencies": { "@dpkit/test": "workspace:*" diff --git a/ods/package.json b/ods/package.json index adbf7183..5f32d86e 100644 --- a/ods/package.json +++ b/ods/package.json @@ -26,7 +26,7 @@ "@dpkit/core": "workspace:*", "@dpkit/file": "workspace:*", "@dpkit/table": "workspace:*", - "nodejs-polars": "^0.21.1", + "nodejs-polars": "^0.21.2", "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz" }, "devDependencies": { diff --git a/parquet/package.json b/parquet/package.json index c9d09d65..4896d48d 100644 --- a/parquet/package.json +++ b/parquet/package.json @@ -27,7 +27,7 @@ "@dpkit/file": "workspace:*", "@dpkit/table": "workspace:*", "csv-sniffer": "^0.1.1", - "nodejs-polars": "^0.21.1" + "nodejs-polars": "^0.21.2" }, "devDependencies": { "@dpkit/test": "workspace:*" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a8e01275..815019b7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -120,8 +120,8 @@ importers: specifier: ^0.1.1 version: 0.1.1 nodejs-polars: - specifier: ^0.21.1 - version: 0.21.1 + specifier: ^0.21.2 + version: 0.21.2 devDependencies: '@dpkit/test': specifier: workspace:* @@ -176,8 +176,8 @@ importers: specifier: ^0.1.1 version: 0.1.1 nodejs-polars: - specifier: ^0.21.1 - version: 0.21.1 + specifier: ^0.21.2 + version: 0.21.2 devDependencies: '@dpkit/test': specifier: workspace:* @@ -204,8 +204,8 @@ importers: specifier: ^3.14.4 version: 3.14.5 nodejs-polars: - specifier: ^0.21.1 - version: 0.21.1 + specifier: ^0.21.2 + version: 0.21.2 pg: specifier: ^8.16.3 version: 8.16.3 @@ -242,8 +242,8 @@ importers: specifier: 5.12.9 version: 5.12.9(@types/node@24.2.0)(rollup@4.50.1)(tsx@4.20.3)(typescript@5.9.2)(yaml@2.8.1) nodejs-polars: - specifier: 0.21.1 - version: 0.21.1 + specifier: 0.21.2 + version: 0.21.2 sharp: specifier: 0.34.2 version: 0.34.2 @@ -290,8 +290,8 @@ importers: specifier: ^6.3.1 version: 6.3.1(@types/react@19.1.9)(react-devtools-core@6.1.5)(react@19.1.1) nodejs-polars: - specifier: ^0.21.0 - version: 0.21.1 + specifier: ^0.21.2 + version: 0.21.2 picocolors: specifier: ^1.1.1 version: 1.1.1 @@ -376,8 +376,8 @@ importers: specifier: workspace:* version: link:../table nodejs-polars: - specifier: ^0.21.1 - version: 0.21.1 + specifier: ^0.21.2 + version: 0.21.2 json: dependencies: @@ -394,8 +394,8 @@ importers: specifier: ^0.1.1 version: 0.1.1 nodejs-polars: - specifier: ^0.21.1 - version: 0.21.1 + specifier: ^0.21.2 + version: 0.21.2 devDependencies: '@dpkit/test': specifier: workspace:* @@ -413,8 +413,8 @@ importers: specifier: workspace:* version: link:../table nodejs-polars: - specifier: ^0.21.1 - version: 0.21.1 + specifier: ^0.21.2 + version: 0.21.2 xlsx: specifier: https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz version: https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz @@ -438,8 +438,8 @@ importers: specifier: ^0.1.1 version: 0.1.1 nodejs-polars: - specifier: ^0.21.1 - version: 0.21.1 + specifier: ^0.21.2 + version: 0.21.2 devDependencies: '@dpkit/test': specifier: workspace:* @@ -478,8 +478,8 @@ importers: specifier: workspace:* version: link:../core nodejs-polars: - specifier: ^0.21.1 - version: 0.21.1 + specifier: ^0.21.2 + version: 0.21.2 test: dependencies: @@ -505,8 +505,8 @@ importers: specifier: workspace:* version: link:../table nodejs-polars: - specifier: ^0.21.1 - version: 0.21.1 + specifier: ^0.21.2 + version: 0.21.2 xlsx: specifier: https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz version: https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz @@ -3332,56 +3332,56 @@ packages: node-mock-http@1.0.3: resolution: {integrity: sha512-jN8dK25fsfnMrVsEhluUTPkBFY+6ybu7jSB1n+ri/vOGjJxU8J9CZhpSGkHXSkFjtUhbmoncG/YG9ta5Ludqog==} - nodejs-polars-android-arm64@0.21.1: - resolution: {integrity: sha512-g/alCp4Hra/ZtVdEwhAb/yDwpdVmLzzK54Z4pL8LwHw/+FK8D1lULk2gDEoaTGy2WDUEa0lOR1PCHwvoXj9XGQ==} + nodejs-polars-android-arm64@0.21.2: + resolution: {integrity: sha512-LUavVQS6kIywk8Jdr8IS+9KbPAI+dxC86v4/7n/FRbZgivzJzIct3NxXJJHlry84OoBChA8RZ4+30YedfY3Axg==} engines: {node: '>= 16'} cpu: [arm64] os: [android] - nodejs-polars-darwin-arm64@0.21.1: - resolution: {integrity: sha512-55GQ0vRlUewTJLTdIl0RrpVl+LuxX9EFrMcMa4G/YlCSiBmzhEliE9pfX0NxKG5NPIQA187K9fLN2ZqwZCMKcA==} + nodejs-polars-darwin-arm64@0.21.2: + resolution: {integrity: sha512-KTelkb8bEQWm/g56sC6oEBLsWHQRdZZHWRxkUNlZpe+EVMPxrbBc2S5/6v+Vu2gpXjC5tJkg1FIzH7v/ovDr/g==} engines: {node: '>= 16'} cpu: [arm64] os: [darwin] - nodejs-polars-darwin-x64@0.21.1: - resolution: {integrity: sha512-3MuSKiHTIlfsvo/LBIgG7kBsxRd/dafGF2mmooCoyIHYETUWamCzSbM3cta5jNOTamDdIWhayuVVk4bQevfRrg==} + nodejs-polars-darwin-x64@0.21.2: + resolution: {integrity: sha512-a+5XNj077t43UAHMVrxcwJfbipSJNljkUXjYoRWh1xTQInA2oo98E72oeeJOTmpK0sohr3Y05qIZuFhit3wc/g==} engines: {node: '>= 16'} cpu: [x64] os: [darwin] - nodejs-polars-linux-arm64-gnu@0.21.1: - resolution: {integrity: sha512-woztH1q88m+dO2mR2lLTxd4Bi88GmsLQAgmDVskxwPUiv8VTOOKtItTzf+Vp2Kg4WIRFAhFiQiTyCqfK9SAhcg==} + nodejs-polars-linux-arm64-gnu@0.21.2: + resolution: {integrity: sha512-7oBtaFQ0JhryXCG7YPazBxhubtxbqKjgKx+hmv9qp+3s2vYtp2TI+hlfoYa1xrFuKDpqvCQwuFWHTN5fZwH+9A==} engines: {node: '>= 16'} cpu: [arm64] os: [linux] - nodejs-polars-linux-arm64-musl@0.21.1: - resolution: {integrity: sha512-7X82Jwutwu6MjhdxHfSX5a9Qgnkrmw11VsSHt755a+/zHym25bcSBFTafZ/wDKIG8gGH7GUKjLTR9Wn0fzHkoQ==} + nodejs-polars-linux-arm64-musl@0.21.2: + resolution: {integrity: sha512-FU26Hj8B2/hNxTiWADoWLlGNDnNyqaDMUOhGTknXZKZM6XL4tok+Nca9AwiSuIUNR7ga27JgmZZ0AlDOWnOYXQ==} engines: {node: '>= 16'} cpu: [arm64] os: [linux] - nodejs-polars-linux-x64-gnu@0.21.1: - resolution: {integrity: sha512-vsf15a0LWBjD3ce7lF10mhI/Ks2SUyVVbxur8r7wYfSEkKPfVmPprWvhTZJ7jjTnmxIvZ9Q+P5McA7mzzq/dAQ==} + nodejs-polars-linux-x64-gnu@0.21.2: + resolution: {integrity: sha512-tjhF1useVeDHeWCl7BB4GQ8AT1ykIBCO4BRBhMdQzKhs53MfXv452eCsApOcV35SabZoTGidFnkKep9DIDCWLg==} engines: {node: '>= 16'} cpu: [x64] os: [linux] - nodejs-polars-linux-x64-musl@0.21.1: - resolution: {integrity: sha512-6bcdDXRyqvDg5JKXOlrnzuqK6HhBggR10a+G/xbmU4tl8dBdm6RvhHQBdMczQF6XD7dRWk8fy6lcW+LjxGrWgQ==} + nodejs-polars-linux-x64-musl@0.21.2: + resolution: {integrity: sha512-U8WyZW1QKKEl4KO4gHKYHdjz7lgBbhxNmr1RRzA08nzynMa5Th5e9+OQd0AkK/YC5OA2GDiEhXLY0PF3j6qe1Q==} engines: {node: '>= 16'} cpu: [x64] os: [linux] - nodejs-polars-win32-x64-msvc@0.21.1: - resolution: {integrity: sha512-Mvgu6fi1iuvKzlyCHMUtDh7z8pESMpic3ejQ17dmcuyJqOX8oxgIoupF8awWqFjWeNWTvEdt2bS+RgAIONHNOQ==} + nodejs-polars-win32-x64-msvc@0.21.2: + resolution: {integrity: sha512-KX8fNcCGagBcXi5aKhus6gNL6lRo+HpPAqF8+0Qrz7Kc+TXwX2hvFFZ/JPPMjEduH/GO70iwksqBLi2ackVHJw==} engines: {node: '>= 16'} cpu: [x64] os: [win32] - nodejs-polars@0.21.1: - resolution: {integrity: sha512-tdKUZuWwZaqDEC4ovVqb/K15uEbV2DizHN59Wl2lJBp3GA1pHAN+7S/7GPDs+xlo3eHDqaslcS2iJDqslZmuWw==} + nodejs-polars@0.21.2: + resolution: {integrity: sha512-nQhNI1x85p7ctb786QdoK8zgovnGOokGb91BHcJZr0WlTexI4sEr+eG24r/4id9d9e6dE3y/FJR7YmWBso8XhA==} engines: {node: '>= 20'} normalize-package-data@6.0.2: @@ -8100,40 +8100,40 @@ snapshots: node-mock-http@1.0.3: {} - nodejs-polars-android-arm64@0.21.1: + nodejs-polars-android-arm64@0.21.2: optional: true - nodejs-polars-darwin-arm64@0.21.1: + nodejs-polars-darwin-arm64@0.21.2: optional: true - nodejs-polars-darwin-x64@0.21.1: + nodejs-polars-darwin-x64@0.21.2: optional: true - nodejs-polars-linux-arm64-gnu@0.21.1: + nodejs-polars-linux-arm64-gnu@0.21.2: optional: true - nodejs-polars-linux-arm64-musl@0.21.1: + nodejs-polars-linux-arm64-musl@0.21.2: optional: true - nodejs-polars-linux-x64-gnu@0.21.1: + nodejs-polars-linux-x64-gnu@0.21.2: optional: true - nodejs-polars-linux-x64-musl@0.21.1: + nodejs-polars-linux-x64-musl@0.21.2: optional: true - nodejs-polars-win32-x64-msvc@0.21.1: + nodejs-polars-win32-x64-msvc@0.21.2: optional: true - nodejs-polars@0.21.1: + nodejs-polars@0.21.2: optionalDependencies: - nodejs-polars-android-arm64: 0.21.1 - nodejs-polars-darwin-arm64: 0.21.1 - nodejs-polars-darwin-x64: 0.21.1 - nodejs-polars-linux-arm64-gnu: 0.21.1 - nodejs-polars-linux-arm64-musl: 0.21.1 - nodejs-polars-linux-x64-gnu: 0.21.1 - nodejs-polars-linux-x64-musl: 0.21.1 - nodejs-polars-win32-x64-msvc: 0.21.1 + nodejs-polars-android-arm64: 0.21.2 + nodejs-polars-darwin-arm64: 0.21.2 + nodejs-polars-darwin-x64: 0.21.2 + nodejs-polars-linux-arm64-gnu: 0.21.2 + nodejs-polars-linux-arm64-musl: 0.21.2 + nodejs-polars-linux-x64-gnu: 0.21.2 + nodejs-polars-linux-x64-musl: 0.21.2 + nodejs-polars-win32-x64-msvc: 0.21.2 normalize-package-data@6.0.2: dependencies: diff --git a/table/field/types/list.spec.ts b/table/field/types/list.spec.ts index 1e66c258..42916f6a 100644 --- a/table/field/types/list.spec.ts +++ b/table/field/types/list.spec.ts @@ -279,7 +279,9 @@ describe("stringifyListField", () => { // Empty array [[], ""], ])("%s -> %s", async (value, expected) => { - const table = DataFrame([Series("name", [value], DataType.String)]).lazy() + const table = DataFrame([ + Series("name", [value], DataType.List(DataType.String)), + ]).lazy() const schema = { fields: [{ name: "name", type: "list" as const, delimiter: ";" }], diff --git a/table/field/types/time.spec.ts b/table/field/types/time.spec.ts index fa273f05..740aca5e 100644 --- a/table/field/types/time.spec.ts +++ b/table/field/types/time.spec.ts @@ -6,7 +6,7 @@ import { denormalizeTable } from "../../table/index.ts" describe("parseTimeField", () => { it.each([ // Default format tests - ["06:00:00", 6 * 60 * 60 * 10 ** 9, {}], + ["06:00:00", "06:00:00", {}], // #TODO: Clarify the behavior on the Standard level first //["06:00:00Z", 6 * 60 * 60 * 10 ** 9, {}], ["09:00", null, {}], // Incomplete time @@ -16,7 +16,7 @@ describe("parseTimeField", () => { ["", null, {}], // Custom format tests - ["06:00", 6 * 60 * 60 * 10 ** 9, { format: "%H:%M" }], + ["06:00", "06:00:00", { format: "%H:%M" }], ["06:50", null, { format: "%M:%H" }], // Invalid format ["3:00 am", null, { format: "%H:%M" }], // Not matching the format ["some night", null, { format: "%H:%M" }], diff --git a/table/package.json b/table/package.json index 4dd85f32..5fbae2fd 100644 --- a/table/package.json +++ b/table/package.json @@ -23,7 +23,7 @@ "build": "tsc" }, "dependencies": { - "nodejs-polars": "^0.21.1", + "nodejs-polars": "^0.21.2", "@dpkit/core": "workspace:*" } } diff --git a/table/schema/infer.ts b/table/schema/infer.ts index ef63d080..4c5b54ae 100644 --- a/table/schema/infer.ts +++ b/table/schema/infer.ts @@ -51,8 +51,14 @@ export function inferSchemaFromSample( throw new Error(`Field "${name}" not found in the table`) } - let type = - fieldTypes?.[name] ?? typeMapping[polarsField.type.variant] ?? "any" + // TODO: Remove this workaround once the issue is fixed + // https://github.com/pola-rs/nodejs-polars/issues/372 + let variant = polarsField.type.variant as string + if (!typeMapping[variant]) { + variant = variant.slice(0, -1) + } + + let type = fieldTypes?.[name] ?? typeMapping[variant] ?? "any" if (type === "array" && options?.arrayType === "list") { type = "list" diff --git a/xlsx/package.json b/xlsx/package.json index 89e07c42..ef47fd33 100644 --- a/xlsx/package.json +++ b/xlsx/package.json @@ -26,7 +26,7 @@ "@dpkit/core": "workspace:*", "@dpkit/file": "workspace:*", "@dpkit/table": "workspace:*", - "nodejs-polars": "^0.21.1", + "nodejs-polars": "^0.21.2", "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz" }, "devDependencies": {