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(dashboard): add subTypes aspect to dashboard entity #5843

Merged

Conversation

Masterchen09
Copy link
Contributor

I am currently working on a source for the SAP Analytics Cloud to ingest dashboards. The SAP Analytics Cloud has two types of dashboards with a different set of features: Stories and Analytic Applications

This PR adds the subTypes aspect to the dashboard entity to distinguish between these two (sub)types of dashboards.

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
Copy link

github-actions bot commented Sep 6, 2022

Unit Test Results (metadata ingestion)

       8 files         8 suites   59m 10s ⏱️
   708 tests    705 ✔️ 3 💤 0
1 418 runs  1 412 ✔️ 6 💤 0

Results for commit 46a25a1.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Sep 6, 2022

Unit Test Results (build & test)

571 tests  ±0   571 ✔️ ±0   14m 11s ⏱️ -10s
141 suites ±0       0 💤 ±0 
141 files   ±0       0 ±0 

Results for commit 46a25a1. ± Comparison against base commit a86c966.

♻️ This comment has been updated with latest results.

@Masterchen09 Masterchen09 force-pushed the feature-dashboard-subtypes branch 2 times, most recently from 2e3fac2 to 3a9ce80 Compare September 7, 2022 15:25
@shirshanka shirshanka added community-contribution PR or Issue raised by member(s) of DataHub Community product PR or Issue related to the DataHub UI/UX labels Sep 8, 2022
@jjoyce0510
Copy link
Collaborator

We have not forgotten about this- will be reviewing soon

@Masterchen09 Masterchen09 force-pushed the feature-dashboard-subtypes branch from 5563d96 to 06c9408 Compare September 11, 2022 15:31
@@ -179,6 +182,7 @@ export class DashboardEntity implements Entity<Dashboard> {
statsSummary={data.statsSummary}
lastUpdatedMs={data.properties?.lastModified?.time}
createdMs={data.properties?.created?.time}
subtype={data.subTypes?.typeNames?.[0]}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure if this is safe in the case that subTypes is an empty array ([])

@@ -214,6 +218,7 @@ export class DashboardEntity implements Entity<Dashboard> {
inputFields={data.inputFields}
/>
}
subtype={data.subTypes?.typeNames?.[0]}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here

@@ -223,6 +228,7 @@ export class DashboardEntity implements Entity<Dashboard> {
urn: entity.urn,
name: entity.properties?.name || '',
type: EntityType.Dashboard,
subtype: entity?.subTypes?.typeNames?.[0] || undefined,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here

@@ -71,7 +73,7 @@ export const DashboardPreview = ({
url={entityRegistry.getEntityUrl(EntityType.Dashboard, urn)}
name={name || ''}
description={description || ''}
type="Dashboard"
type={capitalizeFirstLetterOnly(subtype) || 'Dashboard'}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this safe if subType is null or undefined?

Copy link
Collaborator

@jjoyce0510 jjoyce0510 left a comment

Choose a reason for hiding this comment

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

All in all this looks good. Only thing is the case where subtypes is present but empty.

Currently that's not a "normal" state of the system, but since our Ingest endpoint is freely available someone could technical produce this aspect (or remove an existing subtype).

We want the system to be resilient to such cases. It may mean refactoring other code (Dataset / Container code) to also make safer calls

@jjoyce0510
Copy link
Collaborator

After giving it some thought, I think we can merge this in and then our team can wholistically address these issues. Once this passes CI, we can merge it and we will take the followups.

Thanks!
John

@jjoyce0510 jjoyce0510 merged commit a407e0a into datahub-project:master Sep 19, 2022
@Masterchen09 Masterchen09 deleted the feature-dashboard-subtypes branch October 16, 2022 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution PR or Issue raised by member(s) of DataHub Community product PR or Issue related to the DataHub UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants