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: Drill to detail on values with comma #21151

Merged

Conversation

michael-s-molina
Copy link
Member

SUMMARY

This PR fixes a bug that was causing incorrect values when right-clicking on charts that contain values with commas.

Original issue: #20728 (comment)

@codyml

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen.Recording.2022-08-22.at.11.39.09.AM.mov

TESTING INSTRUCTIONS

Check that the correct values are displayed when interacting with charts that contain values with commas.

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

@@ -39,12 +39,12 @@ export type QueryObjectFilterClause = {
} & (
| {
op: BinaryOperator;
val: string | number | boolean;
val: string | number | boolean | null | Date;
Copy link
Member

Choose a reason for hiding this comment

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

Why use Date and null object on the filter?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because the values come from the labelMap:

interface EChartTransformedProps<F> {
  labelMap: Record<string, DataRecordValue[]>;
  ...
}

type DataRecordValue = number | string | boolean | Date | null;

@@ -83,6 +83,7 @@ export interface ChartDataResponseResult {
export interface TimeseriesChartDataResponseResult
extends ChartDataResponseResult {
data: TimeseriesDataRecord[];
label_map: Record<string, DataRecordValue[]>;
Copy link
Member

Choose a reason for hiding this comment

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

nits:

Suggested change
label_map: Record<string, DataRecordValue[]>;
label_map: Record<string, string[]>;

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'm using DataRecordValue to keep compatibility with labelMap defined in EChartTransformedProps.

Copy link
Member

Choose a reason for hiding this comment

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

the value of label_map represents parts of columns, it will not be null or Date.

Copy link
Member Author

Choose a reason for hiding this comment

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

Got it. I'll open a follow-up to fix all labelMap references then.

@michael-s-molina michael-s-molina merged commit 0bf4e56 into apache:master Aug 22, 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/L 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants