Skip to content

Commit b1b68b4

Browse files
authored
feat(docs): enhance metadata model entity documentation with field tables and SDK examples (#15095)
1 parent 232bf35 commit b1b68b4

File tree

290 files changed

+21295
-330
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

290 files changed

+21295
-330
lines changed

docs-website/sidebars.js

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// note: to handle errors where you don't want a markdown file in the sidebar, add it as a comment.
22
// this will fix errors like `Error: File not accounted for in sidebar: ...`
3+
// smoke-test/tests/library_examples/README.md
34
module.exports = {
45
overviewSidebar: [
56
// Getting Started.
@@ -682,14 +683,27 @@ module.exports = {
682683
defaultStyle: true,
683684
},
684685
{
685-
"DataHub's Open Metadata Standard": [
686-
"docs/modeling/metadata-model",
687-
"docs/what/mxe",
686+
type: "category",
687+
label: "Open Source DataHub Metadata Standard",
688+
collapsed: false,
689+
items: [
690+
{
691+
type: "doc",
692+
label: "The Metadata Model",
693+
id: "docs/modeling/metadata-model",
694+
},
688695
{
689-
Entities: [
696+
type: "doc",
697+
label: "Core Metadata Events",
698+
id: "docs/what/mxe",
699+
},
700+
{
701+
type: "category",
702+
label: "Entity Docs",
703+
items: [
690704
{
691705
type: "autogenerated",
692-
dirName: "docs/generated/metamodel/entities", // '.' means the current docs folder
706+
dirName: "docs/generated/metamodel/entities",
693707
},
694708
],
695709
},

docs/api/datahub-apis.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Here's an overview of what each API can do.
9393
| Read MLModel |[[Guide]](/docs/api/tutorials/ml.md#read-mlmodel) |[[Guide]](/docs/api/tutorials/ml.md#read-mlmodel) ||
9494
| Read MLModelGroup |[[Guide]](/docs/api/tutorials/ml.md#read-mlmodelgroup) |[[Guide]](/docs/api/tutorials/ml.md#read-mlmodelgroup) ||
9595
| Read MLPrimaryKey |[[Guide]](/docs/api/tutorials/ml.md#read-mlprimarykey) |[[Guide]](/docs/api/tutorials/ml.md#read-mlprimarykey) ||
96-
| Create Data Product | 🚫 |[[Code]](https://github.com/datahub-project/datahub/blob/master/metadata-ingestion/examples/library/create_dataproduct.py) ||
96+
| Create Data Product | 🚫 |[[Code]](https://github.com/datahub-project/datahub/blob/master/metadata-ingestion/examples/library/dataproduct_create.py) ||
9797
| Create Lineage Between Chart and Dashboard | 🚫 |[[Code]](https://github.com/datahub-project/datahub/blob/master/metadata-ingestion/examples/library/lineage_chart_dashboard.py) ||
9898
| Create Lineage Between Dataset and Chart | 🚫 |[[Code]](https://github.com/datahub-project/datahub/blob/master/metadata-ingestion/examples/library/lineage_dataset_chart.py) ||
9999
| Create Lineage Between Dataset and DataJob | 🚫 |[[Code]](https://github.com/datahub-project/datahub/blob/master/metadata-ingestion/examples/library/lineage_dataset_job_dataset.py) ||

docs/api/tutorials/applications.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ If you see the following response, the operation was successful:
5555
<TabItem value="python" label="Python">
5656

5757
```python
58-
{{ inline /metadata-ingestion/examples/library/create_application.py show_path_as_comment }}
58+
{{ inline /metadata-ingestion/examples/library/application_create_full.py show_path_as_comment }}
5959
```
6060

6161
</TabItem>
@@ -146,7 +146,7 @@ If you see the following response, the operation was successful:
146146
<TabItem value="python" label="Python">
147147

148148
```python
149-
{{ inline /metadata-ingestion/examples/library/add_application.py show_path_as_comment }}
149+
{{ inline /metadata-ingestion/examples/library/application_add.py show_path_as_comment }}
150150
```
151151

152152
</TabItem>
@@ -189,7 +189,7 @@ Expected Response:
189189
<TabItem value="python" label="Python">
190190

191191
```python
192-
{{ inline /metadata-ingestion/examples/library/remove_application.py show_path_as_comment }}
192+
{{ inline /metadata-ingestion/examples/library/application_remove.py show_path_as_comment }}
193193
```
194194

195195
</TabItem>

docs/api/tutorials/assertions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,7 @@ If you see the following response, the operation was successful:
14231423
<TabItem value="python" label="Python">
14241424

14251425
```python
1426-
{{ inline /metadata-ingestion/examples/library/delete_assertion.py show_path_as_comment }}
1426+
{{ inline /metadata-ingestion/examples/library/assertion_delete.py show_path_as_comment }}
14271427
```
14281428

14291429
</TabItem>

docs/api/tutorials/container.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ For detailed steps, please refer to [Datahub Quickstart Guide](/docs/quickstart.
3232
<TabItem value="python" label="Python" default>
3333

3434
```python
35-
{{ inline /metadata-ingestion/examples/library/create_container.py show_path_as_comment }}
35+
{{ inline /metadata-ingestion/examples/library/container_create.py show_path_as_comment }}
3636
```
3737

3838
</TabItem>

docs/api/tutorials/dashboard-chart.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,35 +23,35 @@ For detailed steps, please refer to [Datahub Quickstart Guide](/docs/quickstart.
2323
## Create Chart
2424

2525
```python
26-
{{ inline /metadata-ingestion/examples/library/create_chart.py show_path_as_comment }}
26+
{{ inline /metadata-ingestion/examples/library/chart_create_simple.py show_path_as_comment }}
2727
```
2828

2929
### Link Chart with Datasets
3030

3131
You can associate datasets with the chart by providing the dataset URN in the `input_datasets` parameter. This will create lineage between the chart and the datasets, so you can track the data sources used by the chart.
3232

3333
```python
34-
{{ inline /metadata-ingestion/examples/library/create_chart_complex.py show_path_as_comment }}
34+
{{ inline /metadata-ingestion/examples/library/chart_create_complex.py show_path_as_comment }}
3535
```
3636

3737
## Create Dashboard
3838

3939
```python
40-
{{ inline /metadata-ingestion/examples/library/create_dashboard.py show_path_as_comment }}
40+
{{ inline /metadata-ingestion/examples/library/dashboard_create_simple.py show_path_as_comment }}
4141
```
4242

4343
### Link Dashboard with Charts, Dashboards, and Datasets
4444

4545
You can associate charts, dashboards, and datasets with the dashboard by providing their URNs in the `charts`, `dashboards`, and `input_datasets` parameters, respectively. This will create lineage between the dashboard and the associated entities.
4646

4747
```python
48-
{{ inline /metadata-ingestion/examples/library/create_dashboard_complex.py show_path_as_comment }}
48+
{{ inline /metadata-ingestion/examples/library/dashboard_create_complex.py show_path_as_comment }}
4949
```
5050

5151
## Read Chart
5252

5353
```python
54-
{{ inline /metadata-ingestion/examples/library/read_chart.py show_path_as_comment }}
54+
{{ inline /metadata-ingestion/examples/library/chart_read.py show_path_as_comment }}
5555
```
5656

5757
#### Expected Output
@@ -65,7 +65,7 @@ You can associate charts, dashboards, and datasets with the dashboard by providi
6565
## Read Dashboard
6666

6767
```python
68-
{{ inline /metadata-ingestion/examples/library/read_dashboard.py show_path_as_comment }}
68+
{{ inline /metadata-ingestion/examples/library/dashboard_read.py show_path_as_comment }}
6969
```
7070

7171
#### Expected Output

docs/api/tutorials/dataflow-datajob.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ For detailed steps, please refer to [Datahub Quickstart Guide](/docs/quickstart.
2525
<TabItem value="python" label="Python" default>
2626

2727
```python
28-
{{ inline /metadata-ingestion/examples/library/create_dataflow.py show_path_as_comment }}
28+
{{ inline /metadata-ingestion/examples/library/dataflow_create.py show_path_as_comment }}
2929
```
3030

3131
</TabItem>
@@ -39,14 +39,14 @@ DataJob must be associated with a DataFlow. You can create a DataJob by providin
3939
<TabItem value="create-datajob" label="Create DataJob with a DataFlow Object" default>
4040

4141
```python
42-
{{ inline /metadata-ingestion/examples/library/create_datajob.py show_path_as_comment }}
42+
{{ inline /metadata-ingestion/examples/library/datajob_create_full.py show_path_as_comment }}
4343
```
4444

4545
</TabItem>
4646
<TabItem value="create-datajob-urn" label="Create DataJob with DataFlow URN">
4747

4848
```python
49-
{{ inline /metadata-ingestion/examples/library/create_datajob_with_flow_urn.py show_path_as_comment }}
49+
{{ inline /metadata-ingestion/examples/library/datajob_create_with_flow_urn.py show_path_as_comment }}
5050
```
5151

5252
</TabItem>
@@ -55,7 +55,7 @@ DataJob must be associated with a DataFlow. You can create a DataJob by providin
5555
## Read DataFlow
5656

5757
```python
58-
{{ inline /metadata-ingestion/examples/library/read_dataflow.py show_path_as_comment }}
58+
{{ inline /metadata-ingestion/examples/library/dataflow_read.py show_path_as_comment }}
5959
```
6060

6161
#### Example Output
@@ -69,7 +69,7 @@ DataJob must be associated with a DataFlow. You can create a DataJob by providin
6969
## Read DataJob
7070

7171
```python
72-
{{ inline /metadata-ingestion/examples/library/read_datajob.py show_path_as_comment }}
72+
{{ inline /metadata-ingestion/examples/library/datajob_read.py show_path_as_comment }}
7373
```
7474

7575
#### Example Output

docs/api/tutorials/datasets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Expected Response:
109109
<TabItem value="python" label="Python" default>
110110

111111
```python
112-
{{ inline /metadata-ingestion/examples/library/delete_dataset.py show_path_as_comment }}
112+
{{ inline /metadata-ingestion/examples/library/dataset_delete.py show_path_as_comment }}
113113
```
114114

115115
</TabItem>

docs/api/tutorials/domains.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Expected Response:
6464
<TabItem value="python" label="Python">
6565

6666
```python
67-
{{ inline /metadata-ingestion/examples/library/create_domain.py show_path_as_comment }}
67+
{{ inline /metadata-ingestion/examples/library/domain_create.py show_path_as_comment }}
6868
```
6969

7070
</TabItem>
@@ -105,7 +105,7 @@ curl --location --request POST 'http://localhost:8080/api/graphql' \
105105
<TabItem value="python" label="Python">
106106

107107
```python
108-
{{ inline /metadata-ingestion/examples/library/create_nested_domain.py show_path_as_comment }}
108+
{{ inline /metadata-ingestion/examples/library/domain_create_nested.py show_path_as_comment }}
109109
```
110110

111111
</TabItem>

docs/api/tutorials/lineage.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ You can create lineage between two datasets, data jobs, dashboards, or charts. T
3535
#### Add Entity Lineage Between Datasets
3636

3737
```python
38-
{{ inline /metadata-ingestion/examples/library/add_lineage_dataset_to_dataset.py show_path_as_comment }}
38+
{{ inline /metadata-ingestion/examples/library/lineage_dataset_add.py show_path_as_comment }}
3939
```
4040

4141
#### Add Entity Lineage Between Datajobs
@@ -98,7 +98,7 @@ Check out more information on how we handle SQL parsing below.
9898
If you provide a `transformation_text` to `add_lineage`, DataHub will create a query node that represents the transformation logic. This is useful for tracking how data is transformed between datasets.
9999

100100
```python
101-
{{ inline /metadata-ingestion/examples/library/add_lineage_dataset_to_dataset_with_query_node.py show_path_as_comment }}
101+
{{ inline /metadata-ingestion/examples/library/lineage_dataset_add_with_query_node.py show_path_as_comment }}
102102
```
103103

104104
Transformation text can be any transformation logic, Python scripts, Airflow DAG code, or any other code that describes how the upstream dataset is transformed into the downstream dataset.
@@ -124,15 +124,15 @@ The `get_lineage()` method allows you to retrieve lineage for a given entity.
124124
This will return the direct upstream entity that the dataset depends on. By default, it retrieves only the immediate upstream entities (1 hop).
125125

126126
```python
127-
{{ inline /metadata-ingestion/examples/library/get_lineage_basic.py show_path_as_comment }}
127+
{{ inline /metadata-ingestion/examples/library/lineage_get_basic.py show_path_as_comment }}
128128
```
129129

130130
#### Get Downstream Lineage for a Dataset Across Multiple Hops
131131

132132
To get upstream/downstream entities that are more than one hop away, you can use the `max_hops` parameter. This allows you to traverse the lineage graph up to a specified number of hops.
133133

134134
```python
135-
{{ inline /metadata-ingestion/examples/library/get_lineage_with_hops.py show_path_as_comment }}
135+
{{ inline /metadata-ingestion/examples/library/lineage_get_with_hops.py show_path_as_comment }}
136136

137137
```
138138

@@ -165,13 +165,13 @@ results = [
165165
You can retrieve column-level lineage by specifying the `source_column` parameter. This will return lineage paths that include the specified column.
166166

167167
```python
168-
{{ inline /metadata-ingestion/examples/library/get_column_lineage.py show_path_as_comment }}
168+
{{ inline /metadata-ingestion/examples/library/lineage_column_get.py show_path_as_comment }}
169169
```
170170

171171
You can also pass `SchemaFieldUrn` as the `source_urn` to get column-level lineage.
172172

173173
```python
174-
{{ inline /metadata-ingestion/examples/library/get_column_lineage_from_schemafield.py show_path_as_comment }}
174+
{{ inline /metadata-ingestion/examples/library/lineage_column_get_from_schemafield.py show_path_as_comment }}
175175

176176
```
177177

@@ -211,7 +211,7 @@ For more details on how to interpret the results, see [Interpreting Lineage Resu
211211
You can filter by platform, type, domain, environment, and more.
212212

213213
```python
214-
{{ inline /metadata-ingestion/examples/library/get_lineage_with_filter.py show_path_as_comment }}
214+
{{ inline /metadata-ingestion/examples/library/lineage_get_with_filter.py show_path_as_comment }}
215215
```
216216

217217
You can check more details about the available filters in the [Search SDK documentation](./sdk/search_client.md#filter-based-search).

0 commit comments

Comments
 (0)