Skip to content

Commit b2ee2af

Browse files
committed
Adding test cases
1 parent e336513 commit b2ee2af

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

__tests__/lazyframe.test.ts

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,7 @@ describe("lazyframe", () => {
11381138
]);
11391139
expect(actual).toFrameEqualIgnoringOrder(expected);
11401140
});
1141-
test("withColumn/series", async () => {
1141+
test("withColumn:series", async () => {
11421142
const actual: pl.DataFrame = pl
11431143
.DataFrame()
11441144
.lazy()
@@ -1149,7 +1149,7 @@ describe("lazyframe", () => {
11491149
]);
11501150
expect(actual).toFrameEqual(expected);
11511151
});
1152-
test("withColumns/series", async () => {
1152+
test("withColumns:series", async () => {
11531153
const actual: pl.DataFrame = pl
11541154
.DataFrame()
11551155
.lazy()
@@ -1164,29 +1164,45 @@ describe("lazyframe", () => {
11641164
]);
11651165
expect(actual).toFrameEqual(expected);
11661166
});
1167-
test("select/series", async () => {
1168-
const actual: pl.DataFrame = pl
1167+
test("select:series", async () => {
1168+
let actual: pl.DataFrame = pl
11691169
.DataFrame()
11701170
.lazy()
11711171
.select(
11721172
pl.Series("series1", [1, 2, 3, 4], pl.Int16),
11731173
pl.Series("series2", [1, 2, 3, 4], pl.Int32),
11741174
)
11751175
.collectSync();
1176-
const expected: pl.DataFrame = pl.DataFrame([
1176+
let expected: pl.DataFrame = pl.DataFrame([
11771177
pl.Series("series1", [1, 2, 3, 4], pl.Int16),
11781178
pl.Series("series2", [1, 2, 3, 4], pl.Int32),
11791179
]);
11801180
expect(actual).toFrameEqual(expected);
1181+
actual = pl
1182+
.DataFrame({ text: ["hello"] })
1183+
.lazy()
1184+
.select(pl.Series("series", [1, 2, 3]))
1185+
.collectSync();
1186+
1187+
expected = pl.DataFrame([pl.Series("series", [1, 2, 3])]);
1188+
expect(actual).toFrameEqual(expected);
1189+
1190+
actual = pl
1191+
.DataFrame({ text: ["hello"] })
1192+
.lazy()
1193+
.select("text", pl.Series("series", [1]))
1194+
.collectSync();
1195+
expected = pl.DataFrame({ text: ["hello"], series: [1] });
1196+
expect(actual).toFrameEqual(expected);
11811197
});
11821198
test("inspect", () => {
1183-
const _actual = pl
1199+
const actual = pl
11841200
.DataFrame({
11851201
foo: [1, 2, 9],
11861202
bar: [6, 2, 8],
11871203
})
11881204
.lazy();
1189-
// actual();
1205+
expect(actual).toBeDefined();
11901206
});
11911207
test("withColumns", () => {
11921208
const actual = pl

0 commit comments

Comments
 (0)