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(notebook): add data models for Notebook entity #4223

Merged
merged 6 commits into from
Mar 21, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
namespace com.linkedin.metadata.key

/**
* Key for a Notebook
*/
@Aspect = {
"name": "notebookKey",
}
record NotebookKey {
/**
* The name of the Notebook tool such as QueryBook, etc.
*/
notebookTool: string
tc350981 marked this conversation as resolved.
Show resolved Hide resolved

/**
* Unique id for the Notebook. This id should be globally unique for a Notebook tool even when there are multiple deployments of it. As an example, Notebook URL could be used here for QueryBook such as 'querybook.com/notebook/773'
*/
notebookId: string
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace com.linkedin.notebook

/**
* Chart cell in a notebook, which will present content in chart format
*/
record ChartCell includes CommonCellAttributes {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
namespace com.linkedin.notebook

import com.linkedin.common.ChangeAuditStamps

/**
* Common attributes for a cell in a Notebook
*/
record CommonCellAttributes {

/**
* Title of the cell
*/
cellTitle: string
tc350981 marked this conversation as resolved.
Show resolved Hide resolved

/**
* Unique id for the cell. This id should be globally unique for a Notebook tool even when there are multiple deployments of it. As an example, Notebook URL could be used here for QueryBook such as 'querybook.com/notebook/773/?cellId=1234'
*/
cellId: string

/**
* Captures information about who created/last modified/deleted this Notebook cell and when
*/
changeAuditStamps: ChangeAuditStamps
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace com.linkedin.notebook

import com.linkedin.common.ChangeAuditStamps

/**
* Stores editable changes made to properties. This separates changes made from
* ingestion pipelines and edits in the UI to avoid accidental overwrites of user-provided data by ingestion pipelines
*/
@Aspect = {
"name": "editableNotebookProperties"
}
record EditableNotebookProperties includes ChangeAuditStamps {
/**
* Edited documentation of the Notebook
*/
@Searchable = {
"fieldType": "TEXT",
"fieldName": "editedDescription",
}
description: optional string
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
namespace com.linkedin.notebook

/**
* A record of all supported cells for a Notebook. Only one type of cell will be non-null.
*/
record NotebookCell {
/**
* The text cell content. The will be non-null only when all other cell field is null.
*/
textCell: optional TextCell,

/**
* The query cell content. The will be non-null only when all other cell field is null.
*/
queryCell: optional QueryCell,

/**
* The chart cell content. The will be non-null only when all other cell field is null.
*/
chartCell: optional ChartCell

/**
* The type of this Notebook cell
*/
type: NotebookCellType
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace com.linkedin.notebook

/**
* Type of Notebook Cell
*/
enum NotebookCellType {

/**
* TEXT Notebook cell type. The cell context is text only.
*/
TEXT_CELL,

/**
* QUERY Notebook cell type. The cell context is query only.
*/
QUERY_CELL,

/**
* CHART Notebook cell type. The cell content is chart only.
*/
CHART_CELL
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace com.linkedin.notebook

/**
* Content in a Notebook
*/
@Aspect = {
"name": "notebookContent"
}
record NotebookContent {
/**
* The content of a Notebook which is composed by a list of NotebookCell
*/
cells: array[NotebookCell] = []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
namespace com.linkedin.notebook

import com.linkedin.common.ChangeAuditStamps
import com.linkedin.common.Url
import com.linkedin.common.CustomProperties
import com.linkedin.common.ExternalReference

/**
* Information about a Notebook
*/
@Aspect = {
"name": "notebookInfo"
}
record NotebookInfo includes CustomProperties, ExternalReference {

/**
* Title of the Notebook
*/
@Searchable = {
"fieldType": "TEXT_PARTIAL",
"enableAutocomplete": true,
"boostScore": 10.0
}
title: string

/**
* Detailed description about the Notebook
*/
@Searchable = {
"fieldType": "TEXT",
"hasValuesFieldName": "hasDescription"
}
description: optional string

/**
* Captures information about who created/last modified/deleted this Notebook and when
*/
changeAuditStamps: ChangeAuditStamps
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
namespace com.linkedin.notebook

import com.linkedin.common.AuditStamp

/**
* Query cell in a Notebook, which will present content in query format
*/
record QueryCell includes CommonCellAttributes {

/**
* Raw query to explain some specific logic in a Notebook
*/
rawQuery: string

/**
* Captures information about who last executed this query cell and when
*/
lastExecuted: optional AuditStamp
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace com.linkedin.notebook

/**
* Text cell in a Notebook, which will present content in text format
*/
record TextCell includes CommonCellAttributes {
/**
* The actual text in a TextCell in a Notebook
*/
text: string
tc350981 marked this conversation as resolved.
Show resolved Hide resolved
}
15 changes: 15 additions & 0 deletions metadata-models/src/main/resources/entity-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,21 @@ entities:
- domains
- container
- deprecation
- name: notebook
keyAspect: notebookKey
aspects:
- notebookInfo
- notebookContent
- editableNotebookProperties
- ownership
- status
- globalTags
tc350981 marked this conversation as resolved.
Show resolved Hide resolved
- glossaryTerms
- browsePaths
- institutionalMemory
- domains
- subTypes
- dataPlatformInstance
- name: corpuser
doc: CorpUser represents an identity of a person (or an account) in the enterprise.
keyAspect: corpUserKey
Expand Down