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: Show Nested Table Columns #1489

Merged
merged 17 commits into from
Sep 30, 2021
Merged

Feat: Show Nested Table Columns #1489

merged 17 commits into from
Sep 30, 2021

Conversation

danwom
Copy link

@danwom danwom commented Sep 14, 2021

Summary of Changes

In addition to showing nested columns as strings in a modal, we now support showing nested columns as individual rows in the list of columns. Also fixes some bugs where sorting columns would mess up descriptions and nested types.

Tests

Documentation

CheckList

Make sure you have checked all steps below to ensure a timely review.

  • PR title addresses the issue accurately and concisely. Example: "Updates the version of Flask to v1.0.2"
  • PR includes a summary of changes.
  • PR adds unit tests, updates existing unit tests, OR documents why no test additions or modifications are needed.
  • In case of new functionality, my PR adds documentation that describes how to use it.
    • All the public functions and the classes in the PR contain docstrings that explain what it does

Daniel Won added 3 commits September 10, 2021 01:33
Signed-off-by: Daniel Won <dwon@lyft.com>
Signed-off-by: Daniel Won <dwon@lyft.com>
@@ -236,7 +236,7 @@ const Table: React.FC<TableProps> = ({
ref={index === preExpandRow ? expandRowRef : null}
>
<>
{expandRow ? (
{expandRow && item.isExpandable ? (
Copy link
Author

Choose a reason for hiding this comment

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

Probably need to reverse this field or something.

*
* @param columns
*/
export function parseNestedColumns(columns: TableColumn[]) {
Copy link
Member

Choose a reason for hiding this comment

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

Let's test all these helper functions thoroughly.

Daniel Won added 9 commits September 14, 2021 18:02
Signed-off-by: Daniel Won <dwon@lyft.com>
Signed-off-by: Daniel Won <dwon@lyft.com>
Signed-off-by: Daniel Won <dwon@lyft.com>
Signed-off-by: Daniel Won <dwon@lyft.com>
Signed-off-by: Daniel Won <dwon@lyft.com>
Signed-off-by: Daniel Won <dwon@lyft.com>
Signed-off-by: Daniel Won <dwon@lyft.com>
Signed-off-by: Daniel Won <dwon@lyft.com>
Signed-off-by: Daniel Won <dwon@lyft.com>
@@ -280,7 +283,7 @@ const Table: React.FC<TableProps> = ({
})}
</>
</tr>
{expandRow ? (
{expandRow? (
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{expandRow? (
{expandRow ? (

Comment on lines 46 to 47
const nestedType = parseNestedType(column.col_type);
return {
Copy link
Member

@Golodhros Golodhros Sep 29, 2021

Choose a reason for hiding this comment

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

Nit:

Suggested change
const nestedType = parseNestedType(column.col_type);
return {
const nestedType = parseNestedType(column.col_type);
return {

stats: [],
},
];
const result = convertNestedTypeToColumns(nestedType);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const result = convertNestedTypeToColumns(nestedType);
const result = Parser.convertNestedTypeToColumns(nestedType);

Comment on lines 301 to 318
let arrow;
if (nestedLevel > 0) {
arrow = (
<>
<div className={`nesting-arrow-spacer spacer-${nestedLevel}`} />
<NestingArrow />
</>
);
}
return (
<>
{arrow}
<div className="column-name-container">
<h3 className="column-name">{title}</h3>
<p className="column-desc truncated">{description}</p>
</div>
</>
);
Copy link
Member

Choose a reason for hiding this comment

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

I would just do:

Suggested change
let arrow;
if (nestedLevel > 0) {
arrow = (
<>
<div className={`nesting-arrow-spacer spacer-${nestedLevel}`} />
<NestingArrow />
</>
);
}
return (
<>
{arrow}
<div className="column-name-container">
<h3 className="column-name">{title}</h3>
<p className="column-desc truncated">{description}</p>
</div>
</>
);
return (
<>
{nestedLevel > 0 && (<>
<div className={`nesting-arrow-spacer spacer-${nestedLevel}`} />
<NestingArrow />
</>)}
<div className="column-name-container">
<h3 className="column-name">{title}</h3>
<p className="column-desc truncated">{description}</p>
</div>
</>
);

Copy link
Member

@Golodhros Golodhros left a comment

Choose a reason for hiding this comment

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

Looking good!

There seems to be an issue with your prettier or your pre-commit hooks, as there are some formatting issues.

Daniel Won added 3 commits September 29, 2021 15:07
Signed-off-by: Daniel Won <dwon@lyft.com>
Signed-off-by: Daniel Won <dwon@lyft.com>
Signed-off-by: Daniel Won <dwon@lyft.com>
@danwom danwom requested a review from a team as a code owner September 30, 2021 21:41
@danwom danwom changed the title WIP: Show Nested Table Columns Feat: Show Nested Table Columns Sep 30, 2021
Daniel Won added 2 commits September 30, 2021 14:52
Signed-off-by: Daniel Won <dwon@lyft.com>
Signed-off-by: Daniel Won <dwon@lyft.com>
Copy link
Member

@Golodhros Golodhros left a comment

Choose a reason for hiding this comment

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

LGTM

@danwom danwom merged commit 1f246b7 into main Sep 30, 2021
@feng-tao feng-tao deleted the dwon-nested-columns branch October 1, 2021 16:36
@markgrover
Copy link
Contributor

This is awesome, do you have a screenshot here that you could share?

@NiravLangaliya
Copy link

I have one request, Can we have sample data as well ? because we are getting such a good features but can't get visual or understanding better without having sample data.

@jroof88
Copy link
Contributor

jroof88 commented Oct 13, 2021

Hi @danwom. This change significantly derailed the frontend of my organizations Amundsen deployment. Some of the databuilder extractors (namely Delta Lake & BigQuery) scrape for nested columns during the extraction process. They do this because previously there was no nice way to render nested columns on the UI so they just got created as columns. With this UI change these columns are now rendered twice.

New UI change:
Screen Shot 2021-10-06 at 4 35 55 PM

Same columns on same Table Detail Page:
Screen Shot 2021-10-06 at 4 36 17 PM

My ask here is can we roll these types of change out behind a configuration value? This way folks have to deliberately turhn it on. Or if people prefer this way then it can be turned on by default but at least there is a way for me to turn it off. I would still like to have my extractor extract the nested the columns because it is easier to read with the full nested path (especially where there are many levels of nesting) and I can add descriptions to nested columns that way.

cc @markgrover @feng-tao if you have any input.

amommendes pushed a commit to amommendes/amundsen that referenced this pull request Jan 21, 2022
- Parses complex column types and treats the nested columns as children
- Fixes bugs with sorting columns (description, type not updating)


Signed-off-by: Amom Mendes <amommendes@hotmail.com>
ozandogrultan pushed a commit to deliveryhero/amundsen that referenced this pull request Apr 28, 2022
- Parses complex column types and treats the nested columns as children
- Fixes bugs with sorting columns (description, type not updating)

Signed-off-by: Ozan Dogrultan <ozan.dogrultan@deliveryhero.com>
zacr pushed a commit to SaltIO/amundsen that referenced this pull request May 13, 2022
- Parses complex column types and treats the nested columns as children
- Fixes bugs with sorting columns (description, type not updating)
hansadriaans pushed a commit to DataChefHQ/amundsen that referenced this pull request Jun 30, 2022
- Parses complex column types and treats the nested columns as children
- Fixes bugs with sorting columns (description, type not updating)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:frontend From the Frontend folder
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants