nodejs-polars-v0.10.0
·
76 commits
to main
since this release
Highlights
New support for polars sql
π
import pl from "nodejs-polars"
const df = pl.DataFrame({
title: ["The Godfather", "The Dark Knight", "Schindler's List", "Pulp Fiction", "The Shawshank Redemption"],
release_year: [1972, 2008, 1993, 1994, 1994],
budget: [6000000, 185000000, 22000000, 8000000, 25000000],
gross: [134821952, 533316061, 96067179, 107930000, 28341469],
imdb_score: [9.2, 9.0, 8.9, 8.9, 9.3]
});
const ctx = pl.SQLContext({ films: df });
// Execute a SQL query against the registered frame data
const result = ctx.execute(`
SELECT title, release_year, imdb_score
FROM films
WHERE release_year > 1990
ORDER BY imdb_score DESC
`, { eager: true });
console.log(result);
>>> shape: (4, 3)
ββββββββββββββββββββββββββββ¬βββββββββββββββ¬βββββββββββββ
β title β release_year β imdb_score β
β --- β --- β --- β
β str β f64 β f64 β
ββββββββββββββββββββββββββββͺβββββββββββββββͺβββββββββββββ‘
β The Shawshank Redemption β 1994.0 β 9.3 β
β The Dark Knight β 2008.0 β 9.0 β
β Schindler's List β 1993.0 β 8.9 β
β Pulp Fiction β 1994.0 β 8.9 β
ββββββββββββββββββββββββββββ΄βββββββββββββββ΄βββββββββββββ
What's Changed
- Upgrading toolchain by @Bidek56 in #179
- Upgrading biome by @Bidek56 in #182
- Removing unused imports by @Bidek56 in #184
- Adding pivot separator option by @Bidek56 in #181
- feat: add sqlContext by @universalmind303 in #185
- fix: cjs compatibility by @universalmind303 in #187
Full Changelog: nodejs-polars-v0.9.0...nodejs-polars-v0.10.0