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(mixed-timeseries-plugin): Second query stacks stacked on top of first query series #29119

Merged
merged 3 commits into from
Jun 10, 2024

Conversation

kgabryje
Copy link
Member

@kgabryje kgabryje commented Jun 8, 2024

SUMMARY

In Mixed Series chart, when user sets "Stack" option to true for both queries, the series of the second query are stacked on top of the series of the first query. The reason for that is that both queries could have the same stack ids.
This PR introduces stackIdSuffix, which adds _a and _b suffixes to stack ids of queries A and B to ensure that they're unique.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

In the screenshots - the bars represent the second query. Before, they were stacked on top of the series from 1st query.

Before:

image

After:

image

TESTING INSTRUCTIONS

  1. Create Mixed Series chart
  2. Set Stack to true for both queries
  3. Make sure that the series of both queries are stacked separately

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM with a general comment about composite keys.

@@ -225,6 +227,9 @@ export function transformSeries(
} else if (stack && isTrend) {
stackId = getTimeCompareStackId(forecastSeries.type, timeCompare, name);
}
if (stackId && stackIdSuffix) {
stackId += stackIdSuffix;
Copy link
Member

@villebro villebro Jun 9, 2024

Choose a reason for hiding this comment

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

maybe a nit, but a cybersec person once said that you should always use \n as the separator in composite keys in cases where it's unlikely to appear naturally in the original keys. I'm not sure there's lots of collision risk here, but just in case I'd probably use \n instead of _.

Copy link
Member Author

Choose a reason for hiding this comment

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

done 🙂

@kgabryje kgabryje merged commit 68fd189 into apache:master Jun 10, 2024
33 checks passed
@michael-s-molina michael-s-molina added the v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch label Jun 13, 2024
michael-s-molina pushed a commit that referenced this pull request Jun 13, 2024
eschutho pushed a commit that referenced this pull request Jun 23, 2024
@mistercrunch mistercrunch added 🍒 4.0.2 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels labels Jul 24, 2024
eschutho pushed a commit that referenced this pull request Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels plugins size/L v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch viz:charts:echarts Related to Echarts viz:charts:timeseries Related to Timeseries 🍒 4.0.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants