Skip to content

Commit

Permalink
feat(dashboard): Dashboard models update (#1932)
Browse files Browse the repository at this point in the history
* feat(dashboard): Dashboard models update

* Keep chartId/dashboardId fields in the URN definitions and add fields for chartURL/dashboardURL into info aspects

* Rebase and address some comments
  • Loading branch information
Kerem Sahin authored Nov 12, 2020
1 parent 32e18a1 commit 733893f
Show file tree
Hide file tree
Showing 14 changed files with 154 additions and 39 deletions.
32 changes: 32 additions & 0 deletions gms/api/src/main/pegasus/com/linkedin/dashboard/Chart.pdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
namespace com.linkedin.dashboard

import com.linkedin.chart.ChartInfo
import com.linkedin.chart.ChartQuery
import com.linkedin.common.Ownership
import com.linkedin.common.Status

/**
* Metadata for a chart
*/
record Chart includes ChartKey {

/**
* Basic chart information
*/
info: optional ChartInfo

/**
* Information for the chart query which is used for getting data of the chart
*/
query: optional ChartQuery

/**
* Ownership information for the chart
*/
ownership: optional Ownership

/**
* Status information for the chart such as removed or not
*/
status: optional Status
}
25 changes: 25 additions & 0 deletions gms/api/src/main/pegasus/com/linkedin/dashboard/ChartKey.pdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace com.linkedin.dashboard


/**
* Key for chart resource
*/
record ChartKey {
/**
* The name of the dashboard tool such as looker, redash etc.
*/
@validate.strlen = {
"max" : 20,
"min" : 1
}
tool: string

/**
* Unique id for the chart. This id should be globally unique for a dashboarding tool even when there are multiple deployments of it. As an example, chart URL could be used here for Looker such as 'looker.linkedin.com/looks/1234'
*/
@validate.strlen = {
"max" : 200,
"min" : 1
}
chartId: string
}
25 changes: 25 additions & 0 deletions gms/api/src/main/pegasus/com/linkedin/dashboard/Dashboard.pdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace com.linkedin.dashboard

import com.linkedin.common.Ownership
import com.linkedin.common.Status

/**
* Metadata for a dashboard
*/
record Dashboard includes DashboardKey {

/**
* Basic dashboard information
*/
info: optional DashboardInfo

/**
* Ownership information for the dashboard
*/
ownership: optional Ownership

/**
* Status information for the dashboard such as removed or not
*/
status: optional Status
}
25 changes: 25 additions & 0 deletions gms/api/src/main/pegasus/com/linkedin/dashboard/DashboardKey.pdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace com.linkedin.dashboard


/**
* Key for dashboard resource
*/
record DashboardKey {
/**
* The name of the dashboard tool such as looker, redash etc.
*/
@validate.strlen = {
"max" : 20,
"min" : 1
}
tool: string

/**
* Unique id for the dashboard. This id should be globally unique for a dashboarding tool even when there are multiple deployments of it. As an example, dashboard URL could be used here for Looker such as 'looker.linkedin.com/dashboards/1234'
*/
@validate.strlen = {
"max" : 200,
"min" : 1
}
dashboardId: string
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public final class ChartUrn extends Urn {
public static final String ENTITY_TYPE = "chart";

private final String _dashboardTool;

private final String _chartId;

public ChartUrn(String dashboardTool, String chartId) {
Expand Down
14 changes: 7 additions & 7 deletions li-utils/src/main/pegasus/com/linkedin/common/ChartUrn.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ namespace com.linkedin.common
"type" : "string",
"maxLength" : 20
},
{
"name" : "chartId",
"doc" : "Unique id of the chart assigned by the specific dashboard tool",
"type" : "string",
"maxLength" : 20
}],
"maxLength" : 36
{
"name" : "chartId",
"doc" : "Unique id for the chart. This id should be globally unique for a dashboarding tool even when there are multiple deployments of it. As an example, chart URL could be used here for Looker such as 'looker.linkedin.com/looks/1234'",
"type" : "string",
"maxLength" : 200
}],
"maxLength" : 236
}
typeref ChartUrn = string
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ namespace com.linkedin.common
},
{
"name" : "dashboardId",
"doc" : "Unique id of the dashboard assigned by the specific dashboard tool",
"doc" : "Unique id for the dashboard. This id should be globally unique for a dashboarding tool even when there are multiple deployments of it. As an example, dashboard URL could be used here for Looker such as 'looker.linkedin.com/dashboards/1234'",
"type" : "string",
"maxLength" : 20
"maxLength" : 200
}],
"maxLength" : 36
"maxLength" : 240
}
typeref DashboardUrn = string
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ namespace com.linkedin.chart
import com.linkedin.common.AccessLevel
import com.linkedin.common.ChangeAuditStamps
import com.linkedin.common.Time
import com.linkedin.common.Url

/**
* Information about a chart
Expand All @@ -24,6 +25,11 @@ record ChartInfo {
*/
lastModified: ChangeAuditStamps

/**
* URL for the chart. This could be used as an external link on DataHub to allow users access/view the chart
*/
chartUrl: Url

/**
* Data sources for the chart
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,5 @@ record ChartQuery {
/**
* Chart query type
*/
type: enum ChartQueryType {

/**
* LookML queries
*/
LOOKML

/**
* SQL type queries
*/
SQL
}
type: ChartQueryType
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace com.linkedin.chart

enum ChartQueryType {

/**
* LookML queries
*/
LOOKML

/**
* SQL type queries
*/
SQL
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.linkedin.common.AccessLevel
import com.linkedin.common.ChangeAuditStamps
import com.linkedin.common.ChartUrn
import com.linkedin.common.Time
import com.linkedin.common.Url

/**
* Information about a dashboard
Expand All @@ -30,6 +31,11 @@ record DashboardInfo {
*/
lastModified: ChangeAuditStamps

/**
* URL for the dashboard. This could be used as an external link on DataHub to allow users access/view the dashboard
*/
dashboardUrl: optional Url

/**
* Access level for the dashboard
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
namespace com.linkedin.metadata.search

import com.linkedin.chart.ChartQueryType
import com.linkedin.chart.ChartType
import com.linkedin.common.AccessLevel
import com.linkedin.common.ChartUrn
import com.linkedin.common.DatasetUrn

/**
* Data model for Chart entity search
Expand All @@ -28,15 +30,10 @@ record ChartDocument includes BaseDocument {
*/
tool: optional string

/**
* Input datasets for the chart
*/
inputs: optional array[DatasetUrn]

/**
* Chart query type
*/
queryType: optional string
queryType: optional ChartQueryType

/**
* LDAP usernames of corp users who are the owners of this chart
Expand All @@ -46,10 +43,10 @@ record ChartDocument includes BaseDocument {
/**
* Type of the chart
*/
type: optional string
type: optional ChartType

/**
* Access level for the chart
*/
access: optional string
access: optional AccessLevel
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace com.linkedin.metadata.search

import com.linkedin.common.ChartUrn
import com.linkedin.common.AccessLevel
import com.linkedin.common.DashboardUrn

/**
Expand Down Expand Up @@ -28,11 +28,6 @@ record DashboardDocument includes BaseDocument {
*/
tool: optional string

/**
* Ids of the charts in the dashboard
*/
chartIds: optional array[string]

/**
* LDAP usernames of corp users who are the owners of this dashboard
*/
Expand All @@ -41,5 +36,5 @@ record DashboardDocument includes BaseDocument {
/**
* Access level for the dashboard
*/
access: optional string
access: optional AccessLevel
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ namespace com.linkedin.metadata.snapshot
* A union of all supported metadata snapshot types.
*/
typeref Snapshot = union[
ChartSnapshot,
CorpGroupSnapshot,
CorpUserSnapshot,
DashboardSnapshot,
DatasetSnapshot,
DataProcessSnapshot,
MLModelSnapshot,
Expand Down

0 comments on commit 733893f

Please sign in to comment.