feat(dashboard): Dashboard models update (#1932)

* 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
This commit is contained in:
Kerem Sahin 2020-11-12 11:17:22 -08:00 committed by GitHub
parent 32e18a1fc7
commit 733893f5f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 154 additions and 39 deletions

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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) {

View File

@ -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

View File

@ -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

View File

@ -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
@ -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
*/

View File

@ -13,16 +13,5 @@ record ChartQuery {
/**
* Chart query type
*/
type: enum ChartQueryType {
/**
* LookML queries
*/
LOOKML
/**
* SQL type queries
*/
SQL
}
type: ChartQueryType
}

View File

@ -0,0 +1,14 @@
namespace com.linkedin.chart
enum ChartQueryType {
/**
* LookML queries
*/
LOOKML
/**
* SQL type queries
*/
SQL
}

View File

@ -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
@ -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
*/

View File

@ -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
@ -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
@ -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
}

View File

@ -1,6 +1,6 @@
namespace com.linkedin.metadata.search
import com.linkedin.common.ChartUrn
import com.linkedin.common.AccessLevel
import com.linkedin.common.DashboardUrn
/**
@ -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
*/
@ -41,5 +36,5 @@ record DashboardDocument includes BaseDocument {
/**
* Access level for the dashboard
*/
access: optional string
access: optional AccessLevel
}

View File

@ -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,