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: custom SQL in the XAxis #21847

Merged
merged 2 commits into from
Oct 19, 2022

Conversation

zhaoyongjie
Copy link
Member

@zhaoyongjie zhaoyongjie commented Oct 18, 2022

SUMMARY

To fix custom SQL can't apply on the XAxis when FF is enable.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

After

image

Before

image

TESTING INSTRUCTIONS

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

@zhaoyongjie zhaoyongjie marked this pull request as ready for review October 18, 2022 09:02
@codecov
Copy link

codecov bot commented Oct 18, 2022

Codecov Report

Merging #21847 (7e4c234) into master (f41d0b0) will decrease coverage by 0.00%.
The diff coverage is 88.23%.

@@            Coverage Diff             @@
##           master   #21847      +/-   ##
==========================================
- Coverage   66.82%   66.82%   -0.01%     
==========================================
  Files        1805     1805              
  Lines       69070    69079       +9     
  Branches     7373     7379       +6     
==========================================
+ Hits        46159    46164       +5     
- Misses      21005    21009       +4     
  Partials     1906     1906              
Flag Coverage Δ
javascript 53.33% <88.23%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...src/BigNumber/BigNumberWithTrendline/buildQuery.ts 0.00% <0.00%> (ø)
...hart-echarts/src/MixedTimeseries/transformProps.ts 0.00% <0.00%> (ø)
...t-ui-chart-controls/src/operators/pivotOperator.ts 100.00% <100.00%> (ø)
...ui-chart-controls/src/operators/prophetOperator.ts 100.00% <100.00%> (ø)
...-ui-chart-controls/src/operators/renameOperator.ts 100.00% <100.00%> (ø)
...controls/src/operators/timeComparePivotOperator.ts 100.00% <100.00%> (ø)
...nd/packages/superset-ui-core/src/query/getXAxis.ts 100.00% <100.00%> (ø)
...BigNumber/BigNumberWithTrendline/transformProps.ts 47.05% <100.00%> (ø)
...in-chart-echarts/src/MixedTimeseries/buildQuery.ts 100.00% <100.00%> (ø)
.../plugin-chart-echarts/src/Timeseries/buildQuery.ts 71.42% <100.00%> (ø)
... and 6 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

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 - also left an optional naming idea to consider.

@@ -30,7 +30,7 @@ export const pivotOperator: PostProcessingFactory<PostProcessingPivot> = (
queryObject,
) => {
const metricLabels = ensureIsArray(queryObject.metrics).map(getMetricLabel);
const xAxis = getXAxis(formData);
const xAxis = getXAxisLabel(formData);
Copy link
Member

Choose a reason for hiding this comment

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

Just a thought: As we now have different utils for extracting the column and the label, should we be more specific here and call this xAxisLabel

Copy link
Member Author

Choose a reason for hiding this comment

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

I have to use getXAxisLabel and getXAxixColumn because exist some naming conflicts. Another reason is explicitly naming a function rather than a variable.

image

Copy link
Member

Choose a reason for hiding this comment

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

@ zhaoyongjie I believe @villebro was referring to the variable name as opposed to the function, i.e.,

const xAxisLabel = getXAxisLabel(formData);

Copy link
Member Author

Choose a reason for hiding this comment

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

@john-bodley update these at PR

import { PostProcessingFactory } from './types';

/* eslint-disable @typescript-eslint/no-unused-vars */
export const prophetOperator: PostProcessingFactory<PostProcessingProphet> = (
formData,
queryObject,
) => {
const xAxis = getXAxis(formData);
const xAxis = getXAxisLabel(formData);
Copy link
Member

Choose a reason for hiding this comment

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

same here (and in other places below, too)

@zhaoyongjie zhaoyongjie merged commit 0a4ecca into apache:master Oct 19, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 labels Mar 13, 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 size/M 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants