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

feat(ui): Supporting display of columns and storage count in previews #7198

Conversation

jjoyce0510
Copy link
Collaborator

Summary

In this PR we introduce support for a) column count and b) storage size in bytes on the Dataset Stats Summary - this is shown both on the search card and on the entity profile.

Status

Ready for review

Screenshots

Screen Shot 2023-01-31 at 10 22 24 AM

Screen Shot 2023-01-31 at 10 22 12 AM
Screen Shot 2023-01-31 at 10 28 08 AM

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added ingestion PR or Issue related to the ingestion of metadata product PR or Issue related to the DataHub UI/UX labels Jan 31, 2023
Copy link
Collaborator

@chriscollins3456 chriscollins3456 left a comment

Choose a reason for hiding this comment

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

only one real change requested (using rowCount instead of columnCount otherwise some minor nits - otherwise great stuff!

Comment on lines 35 to 42
const formatBytesStat = (bytes: number) => {
const formattedBytes = formatBytes(bytes);
return (
<Tooltip title={`This dataset consumes ${formatNumberWithoutAbbreviation(bytes)} bytes of storage.`}>
<b>{formattedBytes.number}</b> {formattedBytes.unit}
</Tooltip>
);
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is really more of a new component and not so much a helper function. so maybe we call this FormattedBytesStat that accepts bytes as a prop?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah i like that!

Comment on lines 61 to 62
)) ||
undefined}
Copy link
Collaborator

Choose a reason for hiding this comment

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

nitty nit: the || undefined here isn't necessary! if you do {!!columnCount && (... it will only render what comes next if !!columnCount is truthy

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

awesome! will change


const k = 1000; // We use IEEE standards definition of units of byte, where 1000 bytes = 1kb.
const dm = decimals < 0 ? 0 : decimals;
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
Copy link
Collaborator

Choose a reason for hiding this comment

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

lol at "ZB" and "YB" that's a lotta bytes

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hahaha

Copy link
Collaborator

@chriscollins3456 chriscollins3456 left a comment

Choose a reason for hiding this comment

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

nice rice 👍

@chriscollins3456
Copy link
Collaborator

@jjoyce0510 seeing build failing with :datahub-web-react:yarnTest - i think this might be a situation with frontend tests failing because we're querying for a new field and it hasn't been added to mocks

@jjoyce0510 jjoyce0510 force-pushed the jj--add-storage-size-column-count-to-stats branch from 5af5846 to a304f71 Compare February 1, 2023 21:17
@jjoyce0510 jjoyce0510 merged commit c150ef0 into datahub-project:master Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ingestion PR or Issue related to the ingestion of metadata product PR or Issue related to the DataHub UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants