-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Get rid of the strange looking 0 following "Running..." and "runtime" #7099
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
Get rid of the strange looking 0 following "Running..." and "runtime" #7099
Conversation
@@ -67,10 +68,9 @@ export default function QueryExecutionMetadata({ | |||
)} | |||
{isQueryExecuting && <span>Running…</span>} | |||
</span> | |||
{queryResultData.metadata.data_scanned && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the reason for having this conditional is to prevent showing "Data scanned" for data sources that don't support it, which is actually most data sources Redash supports.
How about we change this conditional to something like:
isDefined(queryResultData.metadata.data_scanned) &&
Instead of just assuming it's a boolean? This way if it's a zero it will show and if it wasn't defined, it will be ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's defined and it's 0, with the updated version it will show "Data Scanned 0 bytes", no? Kind of same behavior as you would see with your suggested change, but only for data sources that actually define data_scanned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here is what i tried (couldn't find a isDefined
so i used !isUndefined
)
import {isUndefined} from "lodash";
{!isUndefined(queryResultData.metadata.data_scanned) && (
<span className="m-l-5">
Data Scanned <strong>{prettySize(queryResultData.metadata.data_scanned)}</strong>
</span>
)}
the answer is yes and no, there are 2 states here
- when query execution is done, you do see the correct message
244 rows 8 seconds runtime Data Scanned 0 bytes
- when query is still executing, you'll see
244 rows Running… Data Scanned 0 bytes
which is a bit confusing because the query is still running
but i do see your point, with only the !isQueryExecuting
, when "Data scanned" is not supported, we are seeing 3 rows 4 seconds runtimeData Scanned ?
so i think we should do both
!isUndefined(queryResultData.metadata.data_scanned) && !isQueryExecuting
otherwise we could get "Data Scanned ?" if it's not supported by some data sources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…getredash#7099) * Snapshot: 24.08.0-dev * no more Running...0 or runtime0 * also missing a space * Restyled by prettier * check if data_scanned is defined otherwise we could get "Data Scanned ?" if it's not supported by some data sources --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Restyled.io <commits@restyled.io>
What type of PR is this?
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:

When query finishes running:

This is because the
block ends up being the "0".
After applying the code changes in the PR:
When query is running:

When query finishes running:

The
queryResultData.metadata.data_scanned &&
is unnecessary since theprettySize
is able to deal with null valuesHow is this tested?
Related Tickets & Documents
Mobile & Desktop Screenshots/Recordings (if there are UI changes)
See attached screenshots above.