Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter 'IN' not working on more than a column. #2870

Closed
MPizzotti opened this issue Dec 5, 2024 · 1 comment
Closed

filter 'IN' not working on more than a column. #2870

MPizzotti opened this issue Dec 5, 2024 · 1 comment

Comments

@MPizzotti
Copy link

MPizzotti commented Dec 5, 2024

Bug Report

Overview

Using perspective-viewer library, the 'IN' filter, used for filtering the dataframe, is not working as expected, when filtering 2 or more columns with one or more element as values.

details

I need to filter data using the IN operator on many values, on different column, for my use case, but i'm unable to set up the perspective view for this blocking error.
the error can be simulated trough the standard Perspective demo: https://perspective.finos.org/block/?example=file, using the below example file and config:
example_dataset.csv

  "version": "3.1.3",
  "plugin": "Datagrid",
  "plugin_config": {
    "columns": {},
    "edit_mode": "READ_ONLY",
    "scroll_lock": false
  },
  "columns_config": {},
  "settings": true,
  "theme": "Pro Light",
  "title": null,
  "group_by": [],
  "split_by": [],
  "columns": [
    "field_aggregation",
    "zone_aggregation"
  ],
  "filter": [
    [
      "field_aggregation",
      "in",
      [
        "Alain Mikli Japan - Alain Mikli Japan",
        "GrandVision Italy - GrandVision Italy"
      ]
    ],
    [
      "zone_aggregation",
      "in",
      [
        "Alain Mikli Japan - Alain Mikli Japan",
        "GrandVision Italy - GrandVision Italy"
      ]
    ]
  ],
  "sort": [],
  "expressions": {},
  "aggregates": {}
}

Here's the error trace from the console:
E0000 00:00:1733414512.436000 1013820 wire_format_lite.cc:603] String field 'perspective.proto.Scalar.string' contains invalid UTF-8 data when serializing a protocol buffer. Use the 'bytes' type if you intend to send raw bytes.
Uncaught (in promise) Error: Undecipherable server message DecodeError { description: "invalid string value: data is not UTF-8 encoded", stack: [("Scalar", "scalar"), ("Filter", "value"), ("ViewConfig", "filter"), ("ViewGetConfigResp", "config"), ("Response", "client_resp")] } at K.t.wbg.__wbindgen_error_new (perspective-viewer.js:1879:21) at 00960502:0x102c4c at 00960502:0x167a98 at 00960502:0x5345e at 00960502:0xb5990 at 00960502:0x186a04 at ae (perspective-viewer.js:302:10) at c (perspective-viewer.js:225:20)

I should expect back the 'IN' filter working correctly.
moreover, i also asserted that all the data is UTF-8.

the error is present also for version 3.1.8.

Notes:

copying directly seems to work, but as soon as the filter is changed (maybe by adding or removing a element from the list),
the error appears.
when creating the view using scripts (in my case sveltekit, but it doesn't matter) the view doesn't throw error but returns empty,
even if the IN filter is correct and should return data.

@texodus
Copy link
Member

texodus commented Dec 5, 2024

Duplicate #2868

@texodus texodus closed this as completed Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants