redash icon indicating copy to clipboard operation
redash copied to clipboard

Get rid of the strange looking 0 following "Running..." and "runtime"

Open zachliu opened this issue 1 year ago • 0 comments
trafficstars

What type of PR is this?

  • [ ] Refactor
  • [ ] Feature
  • [x] Bug Fix
  • [ ] New Query Runner (Data Source)
  • [ ] New Alert Destination
  • [ ] Other

Description

In certain situations such as querying parquet data using Athena, it is possible for the query engine to scan 0 byte of data because of the presence of metadata. Currently when this happens, there is a strange "0" showing up in the UI:

  • When query is running: 2024-08-01_14-21_1

  • When query finishes running: 2024-08-01_14-21

This is because the

        {queryResultData.metadata.data_scanned && (
          <span className="m-l-5">
            Data Scanned
            <strong>{prettySize(queryResultData.metadata.data_scanned)}</strong>
          </span>
        )}

block ends up being the "0".

After applying the code changes in the PR:

  • When query is running: 2024-08-01_14-22

  • When query finishes running: 2024-08-01_14-21_2

The queryResultData.metadata.data_scanned && is unnecessary since the prettySize is able to deal with null values

How is this tested?

  • [ ] Unit tests (pytest, jest)
  • [ ] E2E Tests (Cypress)
  • [ ] Manually
  • [x] N/A

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

See attached screenshots above.

zachliu avatar Aug 01 '24 18:08 zachliu