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

Fix issue where contexts were being notified before gnode state was updated #1136

Merged
merged 4 commits into from
Jul 29, 2020

Conversation

sc1f
Copy link
Contributor

@sc1f sc1f commented Jul 28, 2020

This PR fixes a regression in gnode _process_table, which would notify contexts with a new update dataset before updating the master table maintained by the gnode state. This caused a problem with certain aggregates such as mean and avg, which read from gnode state.

The problem emanates from a specific code path - a table is created with a schema, and a pivoted view with a mean/avg/etc. aggregate is created, and then update is called. If the table is not updated again/a new context is not created, the aggregate values return null as they have been notified with a stale version of the gnode state. In the viewer, it was easy to miss this bug - making any UI changes would create a fresh context, which would make the issue disappear as the contexts were re-synchronized to the latest gnode state.

  • Fixes regression and added tests
  • Fixed traitlets in PerspectiveWidget to allow weighted mean aggregates

@sc1f sc1f added bug Concrete, reproducible bugs C++ Python labels Jul 28, 2020
@sc1f sc1f requested a review from texodus July 28, 2020 15:48
@sc1f sc1f self-assigned this Jul 28, 2020
Copy link
Member

@texodus texodus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

As you stated, "this code needs a once over".

@texodus texodus merged commit 298631c into master Jul 29, 2020
@texodus texodus deleted the fix-python-update branch July 29, 2020 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Concrete, reproducible bugs C++ Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants