Skip to content

Commit 47f2653

Browse files
feat(assertion): enforce strict urns for assertions (#15512)
1 parent 79fef0c commit 47f2653

File tree

12 files changed

+628
-0
lines changed

12 files changed

+628
-0
lines changed

docs/how/updating-datahub.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
- #13726: Default search results per page (new: 5000, old: 10000) can be configured with environment variable `ELASTICSEARCH_LIMIT_RESULTS_API_DEFAULT`
1010
- #13726: Maximum lineage visualization hops (new: 20, old: 1000) can be configured with environment variable `ELASTICSEARCH_SEARCH_GRAPH_LINEAGE_MAX_HOPS`
1111
- #15044: If using the new system-update sqlSetup, the system-update job must be granted privileges to create users, databases, and tables.
12+
- #15512: Assertion related data models will enforce strict urn validation including selective existence, format, and supported entity types. This may impact
13+
existing assertions which would need to be removed from the system.
1214
1315
### Known Issues
1416

metadata-io/src/test/java/com/linkedin/metadata/aspect/validation/AssertionUrnValidationAnnotationTest.java

Lines changed: 361 additions & 0 deletions
Large diffs are not rendered by default.

metadata-models/src/main/pegasus/com/linkedin/assertion/AssertionRunEvent.pdl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ record AssertionRunEvent {
3333
* Urn of entity on which the assertion is applicable
3434
*/
3535
@TimeseriesField = {}
36+
@UrnValidation = {
37+
"exist": false,
38+
"strict": true,
39+
"entityTypes": [ "dataset" ]
40+
}
3641
asserteeUrn: Urn
3742

3843
/**
@@ -60,6 +65,11 @@ record AssertionRunEvent {
6065
* Urn of assertion which is evaluated
6166
*/
6267
@TimeseriesField = {}
68+
@UrnValidation = {
69+
"exist": false,
70+
"strict": true,
71+
"entityTypes": [ "assertion" ]
72+
}
6373
assertionUrn: Urn
6474

6575
/**

metadata-models/src/main/pegasus/com/linkedin/assertion/CustomAssertionInfo.pdl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ record CustomAssertionInfo {
2323
"name": "Asserts",
2424
"entityTypes": [ "dataset" ]
2525
}
26+
@UrnValidation = {
27+
"exist": false,
28+
"strict": true,
29+
"entityTypes": [ "dataset" ]
30+
}
2631
entity: Urn
2732

2833
/**
@@ -34,6 +39,11 @@ record CustomAssertionInfo {
3439
"name": "Asserts",
3540
"entityTypes": [ "schemaField" ]
3641
}
42+
@UrnValidation = {
43+
"exist": false,
44+
"strict": true,
45+
"entityTypes": [ "schemaField" ]
46+
}
3747
field: optional Urn
3848

3949
/*

metadata-models/src/main/pegasus/com/linkedin/assertion/DatasetAssertionInfo.pdl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ record DatasetAssertionInfo {
1313
"name": "Asserts",
1414
"entityTypes": [ "dataset" ]
1515
}
16+
@UrnValidation = {
17+
"exist": false,
18+
"strict": true,
19+
"entityTypes": [ "dataset" ]
20+
}
1621
dataset: Urn
1722

1823
/**
@@ -62,6 +67,11 @@ record DatasetAssertionInfo {
6267
"fieldType": "URN"
6368
}
6469
}
70+
@UrnValidation = {
71+
"exist": false,
72+
"strict": true,
73+
"entityTypes": [ "schemaField" ]
74+
}
6575
fields: optional array[Urn]
6676

6777
/**

metadata-models/src/main/pegasus/com/linkedin/assertion/FieldAssertionInfo.pdl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ record FieldAssertionInfo {
3333
"name": "Asserts",
3434
"entityTypes": [ "dataset" ]
3535
}
36+
@UrnValidation = {
37+
"exist": false,
38+
"strict": true,
39+
"entityTypes": [ "dataset" ]
40+
}
3641
entity: Urn
3742

3843
/**

metadata-models/src/main/pegasus/com/linkedin/assertion/FreshnessAssertionInfo.pdl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ record FreshnessAssertionInfo {
3333
"name": "Asserts",
3434
"entityTypes": [ "dataset", "dataJob" ]
3535
}
36+
@UrnValidation = {
37+
"exist": false,
38+
"strict": true,
39+
"entityTypes": [ "dataset", "dataJob" ]
40+
}
3641
entity: Urn
3742

3843
/**

metadata-models/src/main/pegasus/com/linkedin/assertion/SchemaAssertionInfo.pdl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ record SchemaAssertionInfo {
1717
"name": "Asserts",
1818
"entityTypes": [ "dataset", "dataJob" ]
1919
}
20+
@UrnValidation = {
21+
"exist": false,
22+
"strict": true,
23+
"entityTypes": [ "dataset", "dataJob" ]
24+
}
2025
entity: Urn
2126

2227
/**

metadata-models/src/main/pegasus/com/linkedin/assertion/SqlAssertionInfo.pdl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ record SqlAssertionInfo {
3333
"name": "Asserts",
3434
"entityTypes": [ "dataset" ]
3535
}
36+
@UrnValidation = {
37+
"exist": false,
38+
"strict": true,
39+
"entityTypes": [ "dataset" ]
40+
}
3641
entity: Urn
3742

3843
/**

metadata-models/src/main/pegasus/com/linkedin/assertion/VolumeAssertionInfo.pdl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ record VolumeAssertionInfo {
4747
"name": "Asserts",
4848
"entityTypes": [ "dataset" ]
4949
}
50+
@UrnValidation = {
51+
"exist": false,
52+
"strict": true,
53+
"entityTypes": [ "dataset" ]
54+
}
5055
entity: Urn
5156

5257
/**

0 commit comments

Comments
 (0)