Skip to content
This repository was archived by the owner on Aug 17, 2024. It is now read-only.
This repository was archived by the owner on Aug 17, 2024. It is now read-only.

[BUG] Filtering is not working as expected #131

Open
@andreyshedko

Description

@andreyshedko

Describe the bug
Filtering is not working as expected - sometimes it produces proper results, some time is not.
For example, using this function (or any other comparison operator) in the filtering leads to unpredictable results:

const less = (key: string, value: string, row: Row) => {
  console.log(row.get(key) < value, row.get(key), value);
  return row.get(key) < value;
};

In the other place, we are using a filter with our custom function.

df?.filter(less.bind(this, key, value));

Results:

1) Result of comparison 2) Value from the row 3) Value to compare.
false 67.456981 100 // 67.456981 < 100 === false WAT? 
false 105.229483 100
false 18.839348 100
false 79.228270 100
false 75.535063 100
false 112.173642 100
false 16.632894 100
false 17.532905 100
false 18.245026 100
false 94.522464 100
false 174.695347 100
false 122.806919 100
false 189.747314 100
true 0.000000 100
true 0.000000 100
true 0.000000 100
true 0.000000 100
true 0.000000 100
true 0.000000 100
true 0.000000 100
true 0.000000 100
false 123.263836 100
true 0.007850 100
true 0.000000 100
true 0.000000 100
true 0.000000 100
true 0.000000 100
true 0.000000 100

To Reproduce
Steps to reproduce the behavior:

  1. Create the dataframe
  2. Use filtering on the dataframe.
  3. See error.

Expected behavior
Proper filtering of values.

Desktop (please complete the following information):

  • MacOs Monterey
  • Chrome
  • Node.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions