Skip to content

Big Number does not handle DECIMAL metrics #18222

Closed
@serenajiang

Description

@serenajiang

If the metric for a big number chart has the type DECIMAL, the chart displays an error: No data after filtering or data is NULL for the latest time record

From inspecting the request result for /api/v1/chart/data, it seems like this occurs because the decimal is analyzed as a string.

How to reproduce the bug

  1. Run query in sqllab: SELECT CAST(1 AS DECIMAL) AS x, DATE('2022-01-27') AS ds
  2. Explore chart
  3. Select big number chart, use SUM(x) as metric
  4. Run.

Expected results

Chart shows big number with value 1. Data returned from /api/v1/chart/data is [{SUM(x): 1}]

Actual results

Error is shown. Data returned from /api/v1/chart/data is [{SUM(x): "1"}]

Screenshots

image

Environment

Up to date with apache/master as of 2022-01-26.

Presto SQL

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    #bugBug reportgood first issueGood first issues for new contributorspreset:caresPreset cares about this issuevalidation:requiredA committer should validate the issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions