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

[BUG in Expression] Null or incorrect expression field in JSON output after delete operation #1710

Closed
iscanegemen opened this issue Jan 27, 2022 · 10 comments · Fixed by #2311
Labels
bug Concrete, reproducible bugs C++

Comments

@iscanegemen
Copy link

Bug Report

Applying the delete operation while updating the table creates either incorrect or null results on the resulting expression field in the view.to_json() output in JS, when an expression is applied.

We have created a Github repository for demonstrating the problem via two separate sample poc applications. In the both of these applications we have created, there is a Perspective Viewer with the following expression applied: if (match("string", 'B')) {"float" * -1} else {"float"}

Null outcome: https://github.com/kryaksy/perspective-poc/tree/expression-null-issue
Incorrect outcome: https://github.com/kryaksy/perspective-poc/tree/expression-equality-issue

Steps to Reproduce:

  1. Go to one of the given Github repositories, which demonstrate the null result from the expression and the issue for values that do not match, respectively.
  2. Click on the link under the README file to start the application.
  3. When the application starts, the delete operation is selected by default. The view applies an update, insert and delete operation periodically. When the program encounters a JSON output, it will stop and display the error message.
  4. Inspect the JSON output. Observe that the "exp" value in the JSON output is not correct, according to the expression that is applied.
  5. After having seen the error, uncheck the delete button. It will stop the delete operation and the error will be gone.

Expected Result:

We expect the JSON output to have a correct value for the "exp" field. The absolute value of the "exp" and the "float" fields should match, since the expression only multiplies the value of the "float" field with -1 based on a simple condition inside the if statement.

Actual Result:

The JSON output has null values for the "exp" field or values whose absolute value doesn't match with the value of the "float" column.

Examples include the following:

{
    "string": "FD",
    "float": 0.4013222456195562,
    "exp": 0.6984378020751012
}

Also:

{
    "string": "CA",
    "float": 0.6946245288673509,
    "exp": null
}

Environment:

Perspective version is up-to-date.

Additional Context:

We have also noticed that this error does not occur in Perspective-Viewer, just the view.to_json() output has this issue. Also, this does not occur with the insert and update operations.

@iscanegemen iscanegemen changed the title Null or incorrect expression field in JSON after delete operation Null or incorrect expression field in JSON output after delete operation Jan 27, 2022
@iscanegemen
Copy link
Author

Hi, are there any updates on this issue? It is blocking an important feature.

@kryaksy

This comment was marked as outdated.

@kryaksy
Copy link

kryaksy commented Feb 16, 2022

We realized that the perspective viewer also has the similar issue when configured a group_by.
You can see the issue here:
https://github.com/kryaksy/perspective-poc/tree/expression-equality-issue-in-viewer

@iscanegemen iscanegemen changed the title Null or incorrect expression field in JSON output after delete operation [BUG in Expression] Null or incorrect expression field in JSON output after delete operation Mar 5, 2022
@kryaksy
Copy link

kryaksy commented Mar 8, 2022

Hey @texodus, @sc1f, did you have a chance review this issue?

@kryaksy
Copy link

kryaksy commented Mar 29, 2022

Any update?

@finos finos locked as spam and limited conversation to collaborators Mar 29, 2022
@timkpaine
Copy link
Member

@kryaksy we'll provide updates as soon as they are available, there's no need to ask multiple times on the same issue for updates. We try to do a good job of linking a PR to corresponding issues, so you'll see when something is nearing completion. Otherwise it's best to assume everything is under consideration or in progress pending other priorities.

@finos finos unlocked this conversation Apr 1, 2022
@kryaksy
Copy link

kryaksy commented Apr 1, 2022

@timkpaine Sorry to spam this issue. You may be right. I just wanted to learn if this is a bug or we are doing something wrong or any thought about this. Lesson learned. Thanks for the comment.

@timkpaine
Copy link
Member

@kryaksy no worries! it's almost certainly a bug there's just lots of stuff we're working on and deletes in particular require us to take a deeper look

@kryaksy
Copy link

kryaksy commented Jun 9, 2022

We realized that the perspective viewer also has the similar issue when configured a group_by. You can see the issue here: https://github.com/kryaksy/perspective-poc/tree/expression-equality-issue-in-viewer

It's worth to mention. This issue seems to be resolved in perspective-viewer in v1.4.0. But still current for the other examples.

@texodus
Copy link
Member

texodus commented Jul 20, 2023

I've checked out these repos and they don't do what the bug description says they do (there's no remove(), (not delete() I presume ...), no exp, etc) - rather they seem to just log the JSON output of whatever operations you perform on <perspective-viewer>. A clear repro dramatically reduces the amount of time a developer needs to spend to get up-to-date on an issue, without one I can't really say exactly whether this is a bug or not.

Independent of this, we have had a good repro of a similar-ish sounding bug reported which occurs in the mixed presence of remove() on a group_by context with an expression column. If this is the same issue, it is resolved by #2311. If not, please re-open with the correct repro on v2.3.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Concrete, reproducible bugs C++
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants