coterahq / learn-era-by-example

Get started with the next generation of data science tools
MIT License
7 stars 0 forks source link

Basics/Filtering Test Assertion Question #8

Open j-clemons opened 8 months ago

j-clemons commented 8 months ago

Hi! I am working through this repo and came across an instance in the basics filter that I think could use clarification. Should the assertion in the filtering section have values for b capitalized to match the input data or is the expectation for the user to implement a lower() method?

https://github.com/coterahq/learn-nasty-by-example/blob/39792036ae89cc218fe71adab95ffda93de2ac7f/src/01_the-basics.test.ts#L98-L105

Passing solution with the update to the assertion expectation.

describe("filtering", () => {
  test("only rows where a >= 2", async () => {
    const query = Values(data).where((t) => t.attr("a").gte(2));

    expect(await query.execute(db())).toEqual([
      { a: 2, b: "Bar" },
      { a: 3, b: "Baz" },
    ]);
  });
});
j-clemons commented 8 months ago

I also found an instance in the file of the prompt not matching what gets the test to pass. The combination sort test passes when just removing the skip. So updating the code to match the prompt actually causes the test to fail. https://github.com/coterahq/learn-nasty-by-example/blob/39792036ae89cc218fe71adab95ffda93de2ac7f/src/01_the-basics.test.ts#L125-L137

Please let me know if feedback like this is helpful or wanted at all. I am slowly working through this repo as I am pretty interested if NASTY could be a good addition to my data toolkit, so want to contribute feedback if you are looking for it. Thanks!