acryl-datahub-cloud 0.3.8rc0__py3-none-any.whl → 0.3.8rc1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of acryl-datahub-cloud might be problematic. Click here for more details.

Files changed (33) hide show
  1. acryl_datahub_cloud/_codegen_config.json +1 -1
  2. acryl_datahub_cloud/acryl_cs_issues/source.py +0 -1
  3. acryl_datahub_cloud/datahub_metadata_sharing/__init__.py +0 -0
  4. acryl_datahub_cloud/datahub_metadata_sharing/metadata_sharing_source.py +262 -0
  5. acryl_datahub_cloud/datahub_metadata_sharing/query.py +7 -0
  6. acryl_datahub_cloud/datahub_reporting/datahub_dataset.py +0 -2
  7. acryl_datahub_cloud/datahub_reporting/datahub_form_reporting.py +0 -1
  8. acryl_datahub_cloud/datahub_reporting/extract_graph.py +0 -1
  9. acryl_datahub_cloud/datahub_reporting/extract_sql.py +0 -1
  10. acryl_datahub_cloud/datahub_usage_reporting/query_builder.py +163 -0
  11. acryl_datahub_cloud/datahub_usage_reporting/usage_feature_reporter.py +29 -129
  12. acryl_datahub_cloud/metadata/_urns/urn_defs.py +1612 -1567
  13. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/common/__init__.py +4 -0
  14. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/executor/__init__.py +15 -0
  15. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/metadata/key/__init__.py +2 -0
  16. acryl_datahub_cloud/metadata/schema.avsc +25096 -25347
  17. acryl_datahub_cloud/metadata/schema_classes.py +807 -503
  18. acryl_datahub_cloud/metadata/schemas/ContainerKey.avsc +1 -0
  19. acryl_datahub_cloud/metadata/schemas/DataJobKey.avsc +2 -1
  20. acryl_datahub_cloud/metadata/schemas/DataTransformLogic.avsc +63 -0
  21. acryl_datahub_cloud/metadata/schemas/EntityTypeKey.avsc +1 -0
  22. acryl_datahub_cloud/metadata/schemas/ExecutionRequestInput.avsc +9 -0
  23. acryl_datahub_cloud/metadata/schemas/ExecutionRequestResult.avsc +14 -0
  24. acryl_datahub_cloud/metadata/schemas/PostInfo.avsc +23 -0
  25. acryl_datahub_cloud/metadata/schemas/RemoteExecutorKey.avsc +21 -0
  26. acryl_datahub_cloud/metadata/schemas/RemoteExecutorStatus.avsc +80 -0
  27. acryl_datahub_cloud/metadata/schemas/VersionProperties.avsc +4 -0
  28. acryl_datahub_cloud/metadata/schemas/__init__.py +3 -3
  29. {acryl_datahub_cloud-0.3.8rc0.dist-info → acryl_datahub_cloud-0.3.8rc1.dist-info}/METADATA +34 -33
  30. {acryl_datahub_cloud-0.3.8rc0.dist-info → acryl_datahub_cloud-0.3.8rc1.dist-info}/RECORD +33 -25
  31. {acryl_datahub_cloud-0.3.8rc0.dist-info → acryl_datahub_cloud-0.3.8rc1.dist-info}/WHEEL +1 -1
  32. {acryl_datahub_cloud-0.3.8rc0.dist-info → acryl_datahub_cloud-0.3.8rc1.dist-info}/entry_points.txt +1 -0
  33. {acryl_datahub_cloud-0.3.8rc0.dist-info → acryl_datahub_cloud-0.3.8rc1.dist-info}/top_level.txt +0 -0
@@ -22,64 +22,55 @@ from datahub.utilities.urns.error import InvalidUrnError
22
22
  deprecated = functools.partial(_sphinx_deprecated, version="0.12.0.2")
23
23
 
24
24
  if TYPE_CHECKING:
25
- from datahub.metadata.schema_classes import VersionSetKeyClass
25
+ from datahub.metadata.schema_classes import BusinessAttributeKeyClass
26
26
 
27
- class VersionSetUrn(_SpecificUrn):
28
- ENTITY_TYPE: ClassVar[str] = "versionSet"
29
- URN_PARTS: ClassVar[int] = 2
27
+ class BusinessAttributeUrn(_SpecificUrn):
28
+ ENTITY_TYPE: ClassVar[str] = "businessAttribute"
29
+ URN_PARTS: ClassVar[int] = 1
30
30
 
31
- def __init__(self, id: str, entity_type: str, *, _allow_coercion: bool = True) -> None:
31
+ def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
32
32
  if _allow_coercion:
33
33
  # Field coercion logic (if any is required).
34
34
  id = UrnEncoder.encode_string(id)
35
- entity_type = UrnEncoder.encode_string(entity_type)
36
35
 
37
36
  # Validation logic.
38
37
  if not id:
39
- raise InvalidUrnError("VersionSetUrn id cannot be empty")
38
+ raise InvalidUrnError("BusinessAttributeUrn id cannot be empty")
40
39
  if UrnEncoder.contains_reserved_char(id):
41
- raise InvalidUrnError(f'VersionSetUrn id contains reserved characters')
42
- if not entity_type:
43
- raise InvalidUrnError("VersionSetUrn entity_type cannot be empty")
44
- if UrnEncoder.contains_reserved_char(entity_type):
45
- raise InvalidUrnError(f'VersionSetUrn entity_type contains reserved characters')
40
+ raise InvalidUrnError(f'BusinessAttributeUrn id contains reserved characters')
46
41
 
47
- super().__init__(self.ENTITY_TYPE, [id, entity_type])
42
+ super().__init__(self.ENTITY_TYPE, [id])
48
43
 
49
44
  @classmethod
50
- def _parse_ids(cls, entity_ids: List[str]) -> "VersionSetUrn":
45
+ def _parse_ids(cls, entity_ids: List[str]) -> "BusinessAttributeUrn":
51
46
  if len(entity_ids) != cls.URN_PARTS:
52
- raise InvalidUrnError(f"VersionSetUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
53
- return cls(id=entity_ids[0], entity_type=entity_ids[1], _allow_coercion=False)
47
+ raise InvalidUrnError(f"BusinessAttributeUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
48
+ return cls(id=entity_ids[0], _allow_coercion=False)
54
49
 
55
50
  @classmethod
56
- def underlying_key_aspect_type(cls) -> Type["VersionSetKeyClass"]:
57
- from datahub.metadata.schema_classes import VersionSetKeyClass
51
+ def underlying_key_aspect_type(cls) -> Type["BusinessAttributeKeyClass"]:
52
+ from datahub.metadata.schema_classes import BusinessAttributeKeyClass
58
53
 
59
- return VersionSetKeyClass
54
+ return BusinessAttributeKeyClass
60
55
 
61
- def to_key_aspect(self) -> "VersionSetKeyClass":
62
- from datahub.metadata.schema_classes import VersionSetKeyClass
56
+ def to_key_aspect(self) -> "BusinessAttributeKeyClass":
57
+ from datahub.metadata.schema_classes import BusinessAttributeKeyClass
63
58
 
64
- return VersionSetKeyClass(id=self.id, entityType=self.entity_type)
59
+ return BusinessAttributeKeyClass(id=self.id)
65
60
 
66
61
  @classmethod
67
- def from_key_aspect(cls, key_aspect: "VersionSetKeyClass") -> "VersionSetUrn":
68
- return cls(id=key_aspect.id, entity_type=key_aspect.entityType)
62
+ def from_key_aspect(cls, key_aspect: "BusinessAttributeKeyClass") -> "BusinessAttributeUrn":
63
+ return cls(id=key_aspect.id)
69
64
 
70
65
  @property
71
66
  def id(self) -> str:
72
67
  return self.entity_ids[0]
73
68
 
74
- @property
75
- def entity_type(self) -> str:
76
- return self.entity_ids[1]
77
-
78
69
  if TYPE_CHECKING:
79
- from datahub.metadata.schema_classes import DataHubConnectionKeyClass
70
+ from datahub.metadata.schema_classes import EntityTypeKeyClass
80
71
 
81
- class DataHubConnectionUrn(_SpecificUrn):
82
- ENTITY_TYPE: ClassVar[str] = "dataHubConnection"
72
+ class EntityTypeUrn(_SpecificUrn):
73
+ ENTITY_TYPE: ClassVar[str] = "entityType"
83
74
  URN_PARTS: ClassVar[int] = 1
84
75
 
85
76
  def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
@@ -89,31 +80,31 @@ class DataHubConnectionUrn(_SpecificUrn):
89
80
 
90
81
  # Validation logic.
91
82
  if not id:
92
- raise InvalidUrnError("DataHubConnectionUrn id cannot be empty")
83
+ raise InvalidUrnError("EntityTypeUrn id cannot be empty")
93
84
  if UrnEncoder.contains_reserved_char(id):
94
- raise InvalidUrnError(f'DataHubConnectionUrn id contains reserved characters')
85
+ raise InvalidUrnError(f'EntityTypeUrn id contains reserved characters')
95
86
 
96
87
  super().__init__(self.ENTITY_TYPE, [id])
97
88
 
98
89
  @classmethod
99
- def _parse_ids(cls, entity_ids: List[str]) -> "DataHubConnectionUrn":
90
+ def _parse_ids(cls, entity_ids: List[str]) -> "EntityTypeUrn":
100
91
  if len(entity_ids) != cls.URN_PARTS:
101
- raise InvalidUrnError(f"DataHubConnectionUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
92
+ raise InvalidUrnError(f"EntityTypeUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
102
93
  return cls(id=entity_ids[0], _allow_coercion=False)
103
94
 
104
95
  @classmethod
105
- def underlying_key_aspect_type(cls) -> Type["DataHubConnectionKeyClass"]:
106
- from datahub.metadata.schema_classes import DataHubConnectionKeyClass
96
+ def underlying_key_aspect_type(cls) -> Type["EntityTypeKeyClass"]:
97
+ from datahub.metadata.schema_classes import EntityTypeKeyClass
107
98
 
108
- return DataHubConnectionKeyClass
99
+ return EntityTypeKeyClass
109
100
 
110
- def to_key_aspect(self) -> "DataHubConnectionKeyClass":
111
- from datahub.metadata.schema_classes import DataHubConnectionKeyClass
101
+ def to_key_aspect(self) -> "EntityTypeKeyClass":
102
+ from datahub.metadata.schema_classes import EntityTypeKeyClass
112
103
 
113
- return DataHubConnectionKeyClass(id=self.id)
104
+ return EntityTypeKeyClass(id=self.id)
114
105
 
115
106
  @classmethod
116
- def from_key_aspect(cls, key_aspect: "DataHubConnectionKeyClass") -> "DataHubConnectionUrn":
107
+ def from_key_aspect(cls, key_aspect: "EntityTypeKeyClass") -> "EntityTypeUrn":
117
108
  return cls(id=key_aspect.id)
118
109
 
119
110
  @property
@@ -121,10 +112,10 @@ class DataHubConnectionUrn(_SpecificUrn):
121
112
  return self.entity_ids[0]
122
113
 
123
114
  if TYPE_CHECKING:
124
- from datahub.metadata.schema_classes import DataHubRoleKeyClass
115
+ from datahub.metadata.schema_classes import DataProductKeyClass
125
116
 
126
- class DataHubRoleUrn(_SpecificUrn):
127
- ENTITY_TYPE: ClassVar[str] = "dataHubRole"
117
+ class DataProductUrn(_SpecificUrn):
118
+ ENTITY_TYPE: ClassVar[str] = "dataProduct"
128
119
  URN_PARTS: ClassVar[int] = 1
129
120
 
130
121
  def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
@@ -134,31 +125,31 @@ class DataHubRoleUrn(_SpecificUrn):
134
125
 
135
126
  # Validation logic.
136
127
  if not id:
137
- raise InvalidUrnError("DataHubRoleUrn id cannot be empty")
128
+ raise InvalidUrnError("DataProductUrn id cannot be empty")
138
129
  if UrnEncoder.contains_reserved_char(id):
139
- raise InvalidUrnError(f'DataHubRoleUrn id contains reserved characters')
130
+ raise InvalidUrnError(f'DataProductUrn id contains reserved characters')
140
131
 
141
132
  super().__init__(self.ENTITY_TYPE, [id])
142
133
 
143
134
  @classmethod
144
- def _parse_ids(cls, entity_ids: List[str]) -> "DataHubRoleUrn":
135
+ def _parse_ids(cls, entity_ids: List[str]) -> "DataProductUrn":
145
136
  if len(entity_ids) != cls.URN_PARTS:
146
- raise InvalidUrnError(f"DataHubRoleUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
137
+ raise InvalidUrnError(f"DataProductUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
147
138
  return cls(id=entity_ids[0], _allow_coercion=False)
148
139
 
149
140
  @classmethod
150
- def underlying_key_aspect_type(cls) -> Type["DataHubRoleKeyClass"]:
151
- from datahub.metadata.schema_classes import DataHubRoleKeyClass
141
+ def underlying_key_aspect_type(cls) -> Type["DataProductKeyClass"]:
142
+ from datahub.metadata.schema_classes import DataProductKeyClass
152
143
 
153
- return DataHubRoleKeyClass
144
+ return DataProductKeyClass
154
145
 
155
- def to_key_aspect(self) -> "DataHubRoleKeyClass":
156
- from datahub.metadata.schema_classes import DataHubRoleKeyClass
146
+ def to_key_aspect(self) -> "DataProductKeyClass":
147
+ from datahub.metadata.schema_classes import DataProductKeyClass
157
148
 
158
- return DataHubRoleKeyClass(id=self.id)
149
+ return DataProductKeyClass(id=self.id)
159
150
 
160
151
  @classmethod
161
- def from_key_aspect(cls, key_aspect: "DataHubRoleKeyClass") -> "DataHubRoleUrn":
152
+ def from_key_aspect(cls, key_aspect: "DataProductKeyClass") -> "DataProductUrn":
162
153
  return cls(id=key_aspect.id)
163
154
 
164
155
  @property
@@ -166,10 +157,10 @@ class DataHubRoleUrn(_SpecificUrn):
166
157
  return self.entity_ids[0]
167
158
 
168
159
  if TYPE_CHECKING:
169
- from datahub.metadata.schema_classes import ActionRequestKeyClass
160
+ from datahub.metadata.schema_classes import PlatformResourceKeyClass
170
161
 
171
- class ActionRequestUrn(_SpecificUrn):
172
- ENTITY_TYPE: ClassVar[str] = "actionRequest"
162
+ class PlatformResourceUrn(_SpecificUrn):
163
+ ENTITY_TYPE: ClassVar[str] = "platformResource"
173
164
  URN_PARTS: ClassVar[int] = 1
174
165
 
175
166
  def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
@@ -179,31 +170,31 @@ class ActionRequestUrn(_SpecificUrn):
179
170
 
180
171
  # Validation logic.
181
172
  if not id:
182
- raise InvalidUrnError("ActionRequestUrn id cannot be empty")
173
+ raise InvalidUrnError("PlatformResourceUrn id cannot be empty")
183
174
  if UrnEncoder.contains_reserved_char(id):
184
- raise InvalidUrnError(f'ActionRequestUrn id contains reserved characters')
175
+ raise InvalidUrnError(f'PlatformResourceUrn id contains reserved characters')
185
176
 
186
177
  super().__init__(self.ENTITY_TYPE, [id])
187
178
 
188
179
  @classmethod
189
- def _parse_ids(cls, entity_ids: List[str]) -> "ActionRequestUrn":
180
+ def _parse_ids(cls, entity_ids: List[str]) -> "PlatformResourceUrn":
190
181
  if len(entity_ids) != cls.URN_PARTS:
191
- raise InvalidUrnError(f"ActionRequestUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
182
+ raise InvalidUrnError(f"PlatformResourceUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
192
183
  return cls(id=entity_ids[0], _allow_coercion=False)
193
184
 
194
185
  @classmethod
195
- def underlying_key_aspect_type(cls) -> Type["ActionRequestKeyClass"]:
196
- from datahub.metadata.schema_classes import ActionRequestKeyClass
186
+ def underlying_key_aspect_type(cls) -> Type["PlatformResourceKeyClass"]:
187
+ from datahub.metadata.schema_classes import PlatformResourceKeyClass
197
188
 
198
- return ActionRequestKeyClass
189
+ return PlatformResourceKeyClass
199
190
 
200
- def to_key_aspect(self) -> "ActionRequestKeyClass":
201
- from datahub.metadata.schema_classes import ActionRequestKeyClass
191
+ def to_key_aspect(self) -> "PlatformResourceKeyClass":
192
+ from datahub.metadata.schema_classes import PlatformResourceKeyClass
202
193
 
203
- return ActionRequestKeyClass(id=self.id)
194
+ return PlatformResourceKeyClass(id=self.id)
204
195
 
205
196
  @classmethod
206
- def from_key_aspect(cls, key_aspect: "ActionRequestKeyClass") -> "ActionRequestUrn":
197
+ def from_key_aspect(cls, key_aspect: "PlatformResourceKeyClass") -> "PlatformResourceUrn":
207
198
  return cls(id=key_aspect.id)
208
199
 
209
200
  @property
@@ -211,10 +202,10 @@ class ActionRequestUrn(_SpecificUrn):
211
202
  return self.entity_ids[0]
212
203
 
213
204
  if TYPE_CHECKING:
214
- from datahub.metadata.schema_classes import DataHubIngestionSourceKeyClass
205
+ from datahub.metadata.schema_classes import StructuredPropertyKeyClass
215
206
 
216
- class DataHubIngestionSourceUrn(_SpecificUrn):
217
- ENTITY_TYPE: ClassVar[str] = "dataHubIngestionSource"
207
+ class StructuredPropertyUrn(_SpecificUrn):
208
+ ENTITY_TYPE: ClassVar[str] = "structuredProperty"
218
209
  URN_PARTS: ClassVar[int] = 1
219
210
 
220
211
  def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
@@ -224,31 +215,31 @@ class DataHubIngestionSourceUrn(_SpecificUrn):
224
215
 
225
216
  # Validation logic.
226
217
  if not id:
227
- raise InvalidUrnError("DataHubIngestionSourceUrn id cannot be empty")
218
+ raise InvalidUrnError("StructuredPropertyUrn id cannot be empty")
228
219
  if UrnEncoder.contains_reserved_char(id):
229
- raise InvalidUrnError(f'DataHubIngestionSourceUrn id contains reserved characters')
220
+ raise InvalidUrnError(f'StructuredPropertyUrn id contains reserved characters')
230
221
 
231
222
  super().__init__(self.ENTITY_TYPE, [id])
232
223
 
233
224
  @classmethod
234
- def _parse_ids(cls, entity_ids: List[str]) -> "DataHubIngestionSourceUrn":
225
+ def _parse_ids(cls, entity_ids: List[str]) -> "StructuredPropertyUrn":
235
226
  if len(entity_ids) != cls.URN_PARTS:
236
- raise InvalidUrnError(f"DataHubIngestionSourceUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
227
+ raise InvalidUrnError(f"StructuredPropertyUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
237
228
  return cls(id=entity_ids[0], _allow_coercion=False)
238
229
 
239
230
  @classmethod
240
- def underlying_key_aspect_type(cls) -> Type["DataHubIngestionSourceKeyClass"]:
241
- from datahub.metadata.schema_classes import DataHubIngestionSourceKeyClass
231
+ def underlying_key_aspect_type(cls) -> Type["StructuredPropertyKeyClass"]:
232
+ from datahub.metadata.schema_classes import StructuredPropertyKeyClass
242
233
 
243
- return DataHubIngestionSourceKeyClass
234
+ return StructuredPropertyKeyClass
244
235
 
245
- def to_key_aspect(self) -> "DataHubIngestionSourceKeyClass":
246
- from datahub.metadata.schema_classes import DataHubIngestionSourceKeyClass
236
+ def to_key_aspect(self) -> "StructuredPropertyKeyClass":
237
+ from datahub.metadata.schema_classes import StructuredPropertyKeyClass
247
238
 
248
- return DataHubIngestionSourceKeyClass(id=self.id)
239
+ return StructuredPropertyKeyClass(id=self.id)
249
240
 
250
241
  @classmethod
251
- def from_key_aspect(cls, key_aspect: "DataHubIngestionSourceKeyClass") -> "DataHubIngestionSourceUrn":
242
+ def from_key_aspect(cls, key_aspect: "StructuredPropertyKeyClass") -> "StructuredPropertyUrn":
252
243
  return cls(id=key_aspect.id)
253
244
 
254
245
  @property
@@ -256,216 +247,171 @@ class DataHubIngestionSourceUrn(_SpecificUrn):
256
247
  return self.entity_ids[0]
257
248
 
258
249
  if TYPE_CHECKING:
259
- from datahub.metadata.schema_classes import FormKeyClass
250
+ from datahub.metadata.schema_classes import DataPlatformKeyClass
260
251
 
261
- class FormUrn(_SpecificUrn):
262
- ENTITY_TYPE: ClassVar[str] = "form"
252
+ class DataPlatformUrn(_SpecificUrn):
253
+ ENTITY_TYPE: ClassVar[str] = "dataPlatform"
263
254
  URN_PARTS: ClassVar[int] = 1
264
255
 
265
- def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
256
+ def __init__(self, platform_name: str, *, _allow_coercion: bool = True) -> None:
266
257
  if _allow_coercion:
267
258
  # Field coercion logic (if any is required).
268
- id = UrnEncoder.encode_string(id)
259
+ if platform_name.startswith("urn:li:dataPlatform:"):
260
+ platform_name = DataPlatformUrn.from_string(platform_name).platform_name
261
+ platform_name = UrnEncoder.encode_string(platform_name)
269
262
 
270
263
  # Validation logic.
271
- if not id:
272
- raise InvalidUrnError("FormUrn id cannot be empty")
273
- if UrnEncoder.contains_reserved_char(id):
274
- raise InvalidUrnError(f'FormUrn id contains reserved characters')
264
+ if not platform_name:
265
+ raise InvalidUrnError("DataPlatformUrn platform_name cannot be empty")
266
+ if UrnEncoder.contains_reserved_char(platform_name):
267
+ raise InvalidUrnError(f'DataPlatformUrn platform_name contains reserved characters')
275
268
 
276
- super().__init__(self.ENTITY_TYPE, [id])
269
+ super().__init__(self.ENTITY_TYPE, [platform_name])
277
270
 
278
271
  @classmethod
279
- def _parse_ids(cls, entity_ids: List[str]) -> "FormUrn":
272
+ def _parse_ids(cls, entity_ids: List[str]) -> "DataPlatformUrn":
280
273
  if len(entity_ids) != cls.URN_PARTS:
281
- raise InvalidUrnError(f"FormUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
282
- return cls(id=entity_ids[0], _allow_coercion=False)
274
+ raise InvalidUrnError(f"DataPlatformUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
275
+ return cls(platform_name=entity_ids[0], _allow_coercion=False)
283
276
 
284
277
  @classmethod
285
- def underlying_key_aspect_type(cls) -> Type["FormKeyClass"]:
286
- from datahub.metadata.schema_classes import FormKeyClass
278
+ def underlying_key_aspect_type(cls) -> Type["DataPlatformKeyClass"]:
279
+ from datahub.metadata.schema_classes import DataPlatformKeyClass
287
280
 
288
- return FormKeyClass
281
+ return DataPlatformKeyClass
289
282
 
290
- def to_key_aspect(self) -> "FormKeyClass":
291
- from datahub.metadata.schema_classes import FormKeyClass
283
+ def to_key_aspect(self) -> "DataPlatformKeyClass":
284
+ from datahub.metadata.schema_classes import DataPlatformKeyClass
292
285
 
293
- return FormKeyClass(id=self.id)
286
+ return DataPlatformKeyClass(platformName=self.platform_name)
294
287
 
295
288
  @classmethod
296
- def from_key_aspect(cls, key_aspect: "FormKeyClass") -> "FormUrn":
297
- return cls(id=key_aspect.id)
289
+ def from_key_aspect(cls, key_aspect: "DataPlatformKeyClass") -> "DataPlatformUrn":
290
+ return cls(platform_name=key_aspect.platformName)
291
+
292
+ @classmethod
293
+ @deprecated(reason="Use the constructor instead")
294
+ def create_from_id(cls, id: str) -> "DataPlatformUrn":
295
+ return cls(id)
298
296
 
299
297
  @property
300
- def id(self) -> str:
298
+ def platform_name(self) -> str:
301
299
  return self.entity_ids[0]
302
300
 
303
301
  if TYPE_CHECKING:
304
- from datahub.metadata.schema_classes import NotebookKeyClass
302
+ from datahub.metadata.schema_classes import MLModelKeyClass
305
303
 
306
- class NotebookUrn(_SpecificUrn):
307
- ENTITY_TYPE: ClassVar[str] = "notebook"
308
- URN_PARTS: ClassVar[int] = 2
304
+ class MlModelUrn(_SpecificUrn):
305
+ ENTITY_TYPE: ClassVar[str] = "mlModel"
306
+ URN_PARTS: ClassVar[int] = 3
309
307
 
310
- def __init__(self, notebook_tool: str, notebook_id: str, *, _allow_coercion: bool = True) -> None:
308
+ def __init__(self, platform: str, name: str, env: str = "PROD", *, _allow_coercion: bool = True) -> None:
311
309
  if _allow_coercion:
312
310
  # Field coercion logic (if any is required).
313
- notebook_tool = UrnEncoder.encode_string(notebook_tool)
314
- notebook_id = UrnEncoder.encode_string(notebook_id)
311
+ platform = DataPlatformUrn(platform).urn()
312
+ name = UrnEncoder.encode_string(name)
313
+ env = env.upper()
314
+ env = UrnEncoder.encode_string(env)
315
315
 
316
316
  # Validation logic.
317
- if not notebook_tool:
318
- raise InvalidUrnError("NotebookUrn notebook_tool cannot be empty")
319
- if UrnEncoder.contains_reserved_char(notebook_tool):
320
- raise InvalidUrnError(f'NotebookUrn notebook_tool contains reserved characters')
321
- if not notebook_id:
322
- raise InvalidUrnError("NotebookUrn notebook_id cannot be empty")
323
- if UrnEncoder.contains_reserved_char(notebook_id):
324
- raise InvalidUrnError(f'NotebookUrn notebook_id contains reserved characters')
317
+ if not platform:
318
+ raise InvalidUrnError("MlModelUrn platform cannot be empty")
319
+ platform = str(platform)
320
+ assert DataPlatformUrn.from_string(platform)
321
+ if not name:
322
+ raise InvalidUrnError("MlModelUrn name cannot be empty")
323
+ if UrnEncoder.contains_reserved_char(name):
324
+ raise InvalidUrnError(f'MlModelUrn name contains reserved characters')
325
+ if not env:
326
+ raise InvalidUrnError("MlModelUrn env cannot be empty")
327
+ if UrnEncoder.contains_reserved_char(env):
328
+ raise InvalidUrnError(f'MlModelUrn env contains reserved characters')
325
329
 
326
- super().__init__(self.ENTITY_TYPE, [notebook_tool, notebook_id])
330
+ super().__init__(self.ENTITY_TYPE, [platform, name, env])
327
331
 
328
332
  @classmethod
329
- def _parse_ids(cls, entity_ids: List[str]) -> "NotebookUrn":
333
+ def _parse_ids(cls, entity_ids: List[str]) -> "MlModelUrn":
330
334
  if len(entity_ids) != cls.URN_PARTS:
331
- raise InvalidUrnError(f"NotebookUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
332
- return cls(notebook_tool=entity_ids[0], notebook_id=entity_ids[1], _allow_coercion=False)
335
+ raise InvalidUrnError(f"MlModelUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
336
+ return cls(platform=entity_ids[0], name=entity_ids[1], env=entity_ids[2], _allow_coercion=False)
333
337
 
334
338
  @classmethod
335
- def underlying_key_aspect_type(cls) -> Type["NotebookKeyClass"]:
336
- from datahub.metadata.schema_classes import NotebookKeyClass
339
+ def underlying_key_aspect_type(cls) -> Type["MLModelKeyClass"]:
340
+ from datahub.metadata.schema_classes import MLModelKeyClass
337
341
 
338
- return NotebookKeyClass
342
+ return MLModelKeyClass
339
343
 
340
- def to_key_aspect(self) -> "NotebookKeyClass":
341
- from datahub.metadata.schema_classes import NotebookKeyClass
344
+ def to_key_aspect(self) -> "MLModelKeyClass":
345
+ from datahub.metadata.schema_classes import MLModelKeyClass
342
346
 
343
- return NotebookKeyClass(notebookTool=self.notebook_tool, notebookId=self.notebook_id)
347
+ return MLModelKeyClass(platform=self.platform, name=self.name, origin=self.env)
344
348
 
345
349
  @classmethod
346
- def from_key_aspect(cls, key_aspect: "NotebookKeyClass") -> "NotebookUrn":
347
- return cls(notebook_tool=key_aspect.notebookTool, notebook_id=key_aspect.notebookId)
348
-
349
- @deprecated(reason="Use .notebook_tool instead")
350
- def get_platform_id(self) -> str:
351
- return self.notebook_tool
352
-
353
- @deprecated(reason="Use .notebook_id instead")
354
- def get_notebook_id(self) -> str:
355
- return self.notebook_id
350
+ def from_key_aspect(cls, key_aspect: "MLModelKeyClass") -> "MlModelUrn":
351
+ return cls(platform=key_aspect.platform, name=key_aspect.name, env=key_aspect.origin)
356
352
 
357
353
  @property
358
- def notebook_tool(self) -> str:
354
+ def platform(self) -> str:
359
355
  return self.entity_ids[0]
360
356
 
361
357
  @property
362
- def notebook_id(self) -> str:
358
+ def name(self) -> str:
363
359
  return self.entity_ids[1]
364
360
 
365
- if TYPE_CHECKING:
366
- from datahub.metadata.schema_classes import GlossaryNodeKeyClass
367
-
368
- class GlossaryNodeUrn(_SpecificUrn):
369
- ENTITY_TYPE: ClassVar[str] = "glossaryNode"
370
- URN_PARTS: ClassVar[int] = 1
371
-
372
- def __init__(self, name: str, *, _allow_coercion: bool = True) -> None:
373
- if _allow_coercion:
374
- # Field coercion logic (if any is required).
375
- name = UrnEncoder.encode_string(name)
376
-
377
- # Validation logic.
378
- if not name:
379
- raise InvalidUrnError("GlossaryNodeUrn name cannot be empty")
380
- if UrnEncoder.contains_reserved_char(name):
381
- raise InvalidUrnError(f'GlossaryNodeUrn name contains reserved characters')
382
-
383
- super().__init__(self.ENTITY_TYPE, [name])
384
-
385
- @classmethod
386
- def _parse_ids(cls, entity_ids: List[str]) -> "GlossaryNodeUrn":
387
- if len(entity_ids) != cls.URN_PARTS:
388
- raise InvalidUrnError(f"GlossaryNodeUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
389
- return cls(name=entity_ids[0], _allow_coercion=False)
390
-
391
- @classmethod
392
- def underlying_key_aspect_type(cls) -> Type["GlossaryNodeKeyClass"]:
393
- from datahub.metadata.schema_classes import GlossaryNodeKeyClass
394
-
395
- return GlossaryNodeKeyClass
396
-
397
- def to_key_aspect(self) -> "GlossaryNodeKeyClass":
398
- from datahub.metadata.schema_classes import GlossaryNodeKeyClass
399
-
400
- return GlossaryNodeKeyClass(name=self.name)
401
-
402
- @classmethod
403
- def from_key_aspect(cls, key_aspect: "GlossaryNodeKeyClass") -> "GlossaryNodeUrn":
404
- return cls(name=key_aspect.name)
405
-
406
361
  @property
407
- def name(self) -> str:
408
- return self.entity_ids[0]
362
+ def env(self) -> str:
363
+ return self.entity_ids[2]
409
364
 
410
365
  if TYPE_CHECKING:
411
- from datahub.metadata.schema_classes import DataPlatformInstanceKeyClass
366
+ from datahub.metadata.schema_classes import QueryKeyClass
412
367
 
413
- class DataPlatformInstanceUrn(_SpecificUrn):
414
- ENTITY_TYPE: ClassVar[str] = "dataPlatformInstance"
415
- URN_PARTS: ClassVar[int] = 2
368
+ class QueryUrn(_SpecificUrn):
369
+ ENTITY_TYPE: ClassVar[str] = "query"
370
+ URN_PARTS: ClassVar[int] = 1
416
371
 
417
- def __init__(self, platform: str, instance: str, *, _allow_coercion: bool = True) -> None:
372
+ def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
418
373
  if _allow_coercion:
419
374
  # Field coercion logic (if any is required).
420
- platform = DataPlatformUrn(platform).urn()
421
- instance = UrnEncoder.encode_string(instance)
375
+ id = UrnEncoder.encode_string(id)
422
376
 
423
377
  # Validation logic.
424
- if not platform:
425
- raise InvalidUrnError("DataPlatformInstanceUrn platform cannot be empty")
426
- platform = str(platform)
427
- assert DataPlatformUrn.from_string(platform)
428
- if not instance:
429
- raise InvalidUrnError("DataPlatformInstanceUrn instance cannot be empty")
430
- if UrnEncoder.contains_reserved_char(instance):
431
- raise InvalidUrnError(f'DataPlatformInstanceUrn instance contains reserved characters')
378
+ if not id:
379
+ raise InvalidUrnError("QueryUrn id cannot be empty")
380
+ if UrnEncoder.contains_reserved_char(id):
381
+ raise InvalidUrnError(f'QueryUrn id contains reserved characters')
432
382
 
433
- super().__init__(self.ENTITY_TYPE, [platform, instance])
383
+ super().__init__(self.ENTITY_TYPE, [id])
434
384
 
435
385
  @classmethod
436
- def _parse_ids(cls, entity_ids: List[str]) -> "DataPlatformInstanceUrn":
386
+ def _parse_ids(cls, entity_ids: List[str]) -> "QueryUrn":
437
387
  if len(entity_ids) != cls.URN_PARTS:
438
- raise InvalidUrnError(f"DataPlatformInstanceUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
439
- return cls(platform=entity_ids[0], instance=entity_ids[1], _allow_coercion=False)
388
+ raise InvalidUrnError(f"QueryUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
389
+ return cls(id=entity_ids[0], _allow_coercion=False)
440
390
 
441
391
  @classmethod
442
- def underlying_key_aspect_type(cls) -> Type["DataPlatformInstanceKeyClass"]:
443
- from datahub.metadata.schema_classes import DataPlatformInstanceKeyClass
392
+ def underlying_key_aspect_type(cls) -> Type["QueryKeyClass"]:
393
+ from datahub.metadata.schema_classes import QueryKeyClass
444
394
 
445
- return DataPlatformInstanceKeyClass
395
+ return QueryKeyClass
446
396
 
447
- def to_key_aspect(self) -> "DataPlatformInstanceKeyClass":
448
- from datahub.metadata.schema_classes import DataPlatformInstanceKeyClass
397
+ def to_key_aspect(self) -> "QueryKeyClass":
398
+ from datahub.metadata.schema_classes import QueryKeyClass
449
399
 
450
- return DataPlatformInstanceKeyClass(platform=self.platform, instance=self.instance)
400
+ return QueryKeyClass(id=self.id)
451
401
 
452
402
  @classmethod
453
- def from_key_aspect(cls, key_aspect: "DataPlatformInstanceKeyClass") -> "DataPlatformInstanceUrn":
454
- return cls(platform=key_aspect.platform, instance=key_aspect.instance)
403
+ def from_key_aspect(cls, key_aspect: "QueryKeyClass") -> "QueryUrn":
404
+ return cls(id=key_aspect.id)
455
405
 
456
406
  @property
457
- def platform(self) -> str:
407
+ def id(self) -> str:
458
408
  return self.entity_ids[0]
459
409
 
460
- @property
461
- def instance(self) -> str:
462
- return self.entity_ids[1]
463
-
464
410
  if TYPE_CHECKING:
465
- from datahub.metadata.schema_classes import RoleKeyClass
411
+ from datahub.metadata.schema_classes import DataHubPersonaKeyClass
466
412
 
467
- class RoleUrn(_SpecificUrn):
468
- ENTITY_TYPE: ClassVar[str] = "role"
413
+ class DataHubPersonaUrn(_SpecificUrn):
414
+ ENTITY_TYPE: ClassVar[str] = "dataHubPersona"
469
415
  URN_PARTS: ClassVar[int] = 1
470
416
 
471
417
  def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
@@ -475,31 +421,31 @@ class RoleUrn(_SpecificUrn):
475
421
 
476
422
  # Validation logic.
477
423
  if not id:
478
- raise InvalidUrnError("RoleUrn id cannot be empty")
424
+ raise InvalidUrnError("DataHubPersonaUrn id cannot be empty")
479
425
  if UrnEncoder.contains_reserved_char(id):
480
- raise InvalidUrnError(f'RoleUrn id contains reserved characters')
426
+ raise InvalidUrnError(f'DataHubPersonaUrn id contains reserved characters')
481
427
 
482
428
  super().__init__(self.ENTITY_TYPE, [id])
483
429
 
484
430
  @classmethod
485
- def _parse_ids(cls, entity_ids: List[str]) -> "RoleUrn":
431
+ def _parse_ids(cls, entity_ids: List[str]) -> "DataHubPersonaUrn":
486
432
  if len(entity_ids) != cls.URN_PARTS:
487
- raise InvalidUrnError(f"RoleUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
433
+ raise InvalidUrnError(f"DataHubPersonaUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
488
434
  return cls(id=entity_ids[0], _allow_coercion=False)
489
435
 
490
436
  @classmethod
491
- def underlying_key_aspect_type(cls) -> Type["RoleKeyClass"]:
492
- from datahub.metadata.schema_classes import RoleKeyClass
437
+ def underlying_key_aspect_type(cls) -> Type["DataHubPersonaKeyClass"]:
438
+ from datahub.metadata.schema_classes import DataHubPersonaKeyClass
493
439
 
494
- return RoleKeyClass
440
+ return DataHubPersonaKeyClass
495
441
 
496
- def to_key_aspect(self) -> "RoleKeyClass":
497
- from datahub.metadata.schema_classes import RoleKeyClass
442
+ def to_key_aspect(self) -> "DataHubPersonaKeyClass":
443
+ from datahub.metadata.schema_classes import DataHubPersonaKeyClass
498
444
 
499
- return RoleKeyClass(id=self.id)
445
+ return DataHubPersonaKeyClass(id=self.id)
500
446
 
501
447
  @classmethod
502
- def from_key_aspect(cls, key_aspect: "RoleKeyClass") -> "RoleUrn":
448
+ def from_key_aspect(cls, key_aspect: "DataHubPersonaKeyClass") -> "DataHubPersonaUrn":
503
449
  return cls(id=key_aspect.id)
504
450
 
505
451
  @property
@@ -507,64 +453,55 @@ class RoleUrn(_SpecificUrn):
507
453
  return self.entity_ids[0]
508
454
 
509
455
  if TYPE_CHECKING:
510
- from datahub.metadata.schema_classes import ChartKeyClass
456
+ from datahub.metadata.schema_classes import ActionRequestKeyClass
511
457
 
512
- class ChartUrn(_SpecificUrn):
513
- ENTITY_TYPE: ClassVar[str] = "chart"
514
- URN_PARTS: ClassVar[int] = 2
458
+ class ActionRequestUrn(_SpecificUrn):
459
+ ENTITY_TYPE: ClassVar[str] = "actionRequest"
460
+ URN_PARTS: ClassVar[int] = 1
515
461
 
516
- def __init__(self, dashboard_tool: str, chart_id: str, *, _allow_coercion: bool = True) -> None:
462
+ def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
517
463
  if _allow_coercion:
518
464
  # Field coercion logic (if any is required).
519
- dashboard_tool = UrnEncoder.encode_string(dashboard_tool)
520
- chart_id = UrnEncoder.encode_string(chart_id)
465
+ id = UrnEncoder.encode_string(id)
521
466
 
522
467
  # Validation logic.
523
- if not dashboard_tool:
524
- raise InvalidUrnError("ChartUrn dashboard_tool cannot be empty")
525
- if UrnEncoder.contains_reserved_char(dashboard_tool):
526
- raise InvalidUrnError(f'ChartUrn dashboard_tool contains reserved characters')
527
- if not chart_id:
528
- raise InvalidUrnError("ChartUrn chart_id cannot be empty")
529
- if UrnEncoder.contains_reserved_char(chart_id):
530
- raise InvalidUrnError(f'ChartUrn chart_id contains reserved characters')
468
+ if not id:
469
+ raise InvalidUrnError("ActionRequestUrn id cannot be empty")
470
+ if UrnEncoder.contains_reserved_char(id):
471
+ raise InvalidUrnError(f'ActionRequestUrn id contains reserved characters')
531
472
 
532
- super().__init__(self.ENTITY_TYPE, [dashboard_tool, chart_id])
473
+ super().__init__(self.ENTITY_TYPE, [id])
533
474
 
534
475
  @classmethod
535
- def _parse_ids(cls, entity_ids: List[str]) -> "ChartUrn":
476
+ def _parse_ids(cls, entity_ids: List[str]) -> "ActionRequestUrn":
536
477
  if len(entity_ids) != cls.URN_PARTS:
537
- raise InvalidUrnError(f"ChartUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
538
- return cls(dashboard_tool=entity_ids[0], chart_id=entity_ids[1], _allow_coercion=False)
478
+ raise InvalidUrnError(f"ActionRequestUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
479
+ return cls(id=entity_ids[0], _allow_coercion=False)
539
480
 
540
481
  @classmethod
541
- def underlying_key_aspect_type(cls) -> Type["ChartKeyClass"]:
542
- from datahub.metadata.schema_classes import ChartKeyClass
482
+ def underlying_key_aspect_type(cls) -> Type["ActionRequestKeyClass"]:
483
+ from datahub.metadata.schema_classes import ActionRequestKeyClass
543
484
 
544
- return ChartKeyClass
485
+ return ActionRequestKeyClass
545
486
 
546
- def to_key_aspect(self) -> "ChartKeyClass":
547
- from datahub.metadata.schema_classes import ChartKeyClass
487
+ def to_key_aspect(self) -> "ActionRequestKeyClass":
488
+ from datahub.metadata.schema_classes import ActionRequestKeyClass
548
489
 
549
- return ChartKeyClass(dashboardTool=self.dashboard_tool, chartId=self.chart_id)
490
+ return ActionRequestKeyClass(id=self.id)
550
491
 
551
492
  @classmethod
552
- def from_key_aspect(cls, key_aspect: "ChartKeyClass") -> "ChartUrn":
553
- return cls(dashboard_tool=key_aspect.dashboardTool, chart_id=key_aspect.chartId)
493
+ def from_key_aspect(cls, key_aspect: "ActionRequestKeyClass") -> "ActionRequestUrn":
494
+ return cls(id=key_aspect.id)
554
495
 
555
496
  @property
556
- def dashboard_tool(self) -> str:
497
+ def id(self) -> str:
557
498
  return self.entity_ids[0]
558
499
 
559
- @property
560
- def chart_id(self) -> str:
561
- return self.entity_ids[1]
562
-
563
500
  if TYPE_CHECKING:
564
- from datahub.metadata.schema_classes import ERModelRelationshipKeyClass
501
+ from datahub.metadata.schema_classes import DataHubRoleKeyClass
565
502
 
566
- class ErModelRelationshipUrn(_SpecificUrn):
567
- ENTITY_TYPE: ClassVar[str] = "erModelRelationship"
503
+ class DataHubRoleUrn(_SpecificUrn):
504
+ ENTITY_TYPE: ClassVar[str] = "dataHubRole"
568
505
  URN_PARTS: ClassVar[int] = 1
569
506
 
570
507
  def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
@@ -574,31 +511,31 @@ class ErModelRelationshipUrn(_SpecificUrn):
574
511
 
575
512
  # Validation logic.
576
513
  if not id:
577
- raise InvalidUrnError("ErModelRelationshipUrn id cannot be empty")
514
+ raise InvalidUrnError("DataHubRoleUrn id cannot be empty")
578
515
  if UrnEncoder.contains_reserved_char(id):
579
- raise InvalidUrnError(f'ErModelRelationshipUrn id contains reserved characters')
516
+ raise InvalidUrnError(f'DataHubRoleUrn id contains reserved characters')
580
517
 
581
518
  super().__init__(self.ENTITY_TYPE, [id])
582
519
 
583
520
  @classmethod
584
- def _parse_ids(cls, entity_ids: List[str]) -> "ErModelRelationshipUrn":
521
+ def _parse_ids(cls, entity_ids: List[str]) -> "DataHubRoleUrn":
585
522
  if len(entity_ids) != cls.URN_PARTS:
586
- raise InvalidUrnError(f"ErModelRelationshipUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
523
+ raise InvalidUrnError(f"DataHubRoleUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
587
524
  return cls(id=entity_ids[0], _allow_coercion=False)
588
525
 
589
526
  @classmethod
590
- def underlying_key_aspect_type(cls) -> Type["ERModelRelationshipKeyClass"]:
591
- from datahub.metadata.schema_classes import ERModelRelationshipKeyClass
527
+ def underlying_key_aspect_type(cls) -> Type["DataHubRoleKeyClass"]:
528
+ from datahub.metadata.schema_classes import DataHubRoleKeyClass
592
529
 
593
- return ERModelRelationshipKeyClass
530
+ return DataHubRoleKeyClass
594
531
 
595
- def to_key_aspect(self) -> "ERModelRelationshipKeyClass":
596
- from datahub.metadata.schema_classes import ERModelRelationshipKeyClass
532
+ def to_key_aspect(self) -> "DataHubRoleKeyClass":
533
+ from datahub.metadata.schema_classes import DataHubRoleKeyClass
597
534
 
598
- return ERModelRelationshipKeyClass(id=self.id)
535
+ return DataHubRoleKeyClass(id=self.id)
599
536
 
600
537
  @classmethod
601
- def from_key_aspect(cls, key_aspect: "ERModelRelationshipKeyClass") -> "ErModelRelationshipUrn":
538
+ def from_key_aspect(cls, key_aspect: "DataHubRoleKeyClass") -> "DataHubRoleUrn":
602
539
  return cls(id=key_aspect.id)
603
540
 
604
541
  @property
@@ -606,50 +543,121 @@ class ErModelRelationshipUrn(_SpecificUrn):
606
543
  return self.entity_ids[0]
607
544
 
608
545
  if TYPE_CHECKING:
609
- from datahub.metadata.schema_classes import QueryKeyClass
546
+ from datahub.metadata.schema_classes import NotebookKeyClass
610
547
 
611
- class QueryUrn(_SpecificUrn):
612
- ENTITY_TYPE: ClassVar[str] = "query"
613
- URN_PARTS: ClassVar[int] = 1
548
+ class NotebookUrn(_SpecificUrn):
549
+ ENTITY_TYPE: ClassVar[str] = "notebook"
550
+ URN_PARTS: ClassVar[int] = 2
614
551
 
615
- def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
552
+ def __init__(self, notebook_tool: str, notebook_id: str, *, _allow_coercion: bool = True) -> None:
616
553
  if _allow_coercion:
617
554
  # Field coercion logic (if any is required).
618
- id = UrnEncoder.encode_string(id)
555
+ notebook_tool = UrnEncoder.encode_string(notebook_tool)
556
+ notebook_id = UrnEncoder.encode_string(notebook_id)
619
557
 
620
558
  # Validation logic.
621
- if not id:
622
- raise InvalidUrnError("QueryUrn id cannot be empty")
623
- if UrnEncoder.contains_reserved_char(id):
624
- raise InvalidUrnError(f'QueryUrn id contains reserved characters')
625
-
626
- super().__init__(self.ENTITY_TYPE, [id])
559
+ if not notebook_tool:
560
+ raise InvalidUrnError("NotebookUrn notebook_tool cannot be empty")
561
+ if UrnEncoder.contains_reserved_char(notebook_tool):
562
+ raise InvalidUrnError(f'NotebookUrn notebook_tool contains reserved characters')
563
+ if not notebook_id:
564
+ raise InvalidUrnError("NotebookUrn notebook_id cannot be empty")
565
+ if UrnEncoder.contains_reserved_char(notebook_id):
566
+ raise InvalidUrnError(f'NotebookUrn notebook_id contains reserved characters')
567
+
568
+ super().__init__(self.ENTITY_TYPE, [notebook_tool, notebook_id])
627
569
 
628
570
  @classmethod
629
- def _parse_ids(cls, entity_ids: List[str]) -> "QueryUrn":
571
+ def _parse_ids(cls, entity_ids: List[str]) -> "NotebookUrn":
630
572
  if len(entity_ids) != cls.URN_PARTS:
631
- raise InvalidUrnError(f"QueryUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
632
- return cls(id=entity_ids[0], _allow_coercion=False)
573
+ raise InvalidUrnError(f"NotebookUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
574
+ return cls(notebook_tool=entity_ids[0], notebook_id=entity_ids[1], _allow_coercion=False)
633
575
 
634
576
  @classmethod
635
- def underlying_key_aspect_type(cls) -> Type["QueryKeyClass"]:
636
- from datahub.metadata.schema_classes import QueryKeyClass
577
+ def underlying_key_aspect_type(cls) -> Type["NotebookKeyClass"]:
578
+ from datahub.metadata.schema_classes import NotebookKeyClass
637
579
 
638
- return QueryKeyClass
580
+ return NotebookKeyClass
639
581
 
640
- def to_key_aspect(self) -> "QueryKeyClass":
641
- from datahub.metadata.schema_classes import QueryKeyClass
582
+ def to_key_aspect(self) -> "NotebookKeyClass":
583
+ from datahub.metadata.schema_classes import NotebookKeyClass
642
584
 
643
- return QueryKeyClass(id=self.id)
585
+ return NotebookKeyClass(notebookTool=self.notebook_tool, notebookId=self.notebook_id)
644
586
 
645
587
  @classmethod
646
- def from_key_aspect(cls, key_aspect: "QueryKeyClass") -> "QueryUrn":
647
- return cls(id=key_aspect.id)
588
+ def from_key_aspect(cls, key_aspect: "NotebookKeyClass") -> "NotebookUrn":
589
+ return cls(notebook_tool=key_aspect.notebookTool, notebook_id=key_aspect.notebookId)
590
+
591
+ @deprecated(reason="Use .notebook_tool instead")
592
+ def get_platform_id(self) -> str:
593
+ return self.notebook_tool
594
+
595
+ @deprecated(reason="Use .notebook_id instead")
596
+ def get_notebook_id(self) -> str:
597
+ return self.notebook_id
648
598
 
649
599
  @property
650
- def id(self) -> str:
600
+ def notebook_tool(self) -> str:
601
+ return self.entity_ids[0]
602
+
603
+ @property
604
+ def notebook_id(self) -> str:
605
+ return self.entity_ids[1]
606
+
607
+ if TYPE_CHECKING:
608
+ from datahub.metadata.schema_classes import MLFeatureTableKeyClass
609
+
610
+ class MlFeatureTableUrn(_SpecificUrn):
611
+ ENTITY_TYPE: ClassVar[str] = "mlFeatureTable"
612
+ URN_PARTS: ClassVar[int] = 2
613
+
614
+ def __init__(self, platform: str, name: str, *, _allow_coercion: bool = True) -> None:
615
+ if _allow_coercion:
616
+ # Field coercion logic (if any is required).
617
+ platform = DataPlatformUrn(platform).urn()
618
+ name = UrnEncoder.encode_string(name)
619
+
620
+ # Validation logic.
621
+ if not platform:
622
+ raise InvalidUrnError("MlFeatureTableUrn platform cannot be empty")
623
+ platform = str(platform)
624
+ assert DataPlatformUrn.from_string(platform)
625
+ if not name:
626
+ raise InvalidUrnError("MlFeatureTableUrn name cannot be empty")
627
+ if UrnEncoder.contains_reserved_char(name):
628
+ raise InvalidUrnError(f'MlFeatureTableUrn name contains reserved characters')
629
+
630
+ super().__init__(self.ENTITY_TYPE, [platform, name])
631
+
632
+ @classmethod
633
+ def _parse_ids(cls, entity_ids: List[str]) -> "MlFeatureTableUrn":
634
+ if len(entity_ids) != cls.URN_PARTS:
635
+ raise InvalidUrnError(f"MlFeatureTableUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
636
+ return cls(platform=entity_ids[0], name=entity_ids[1], _allow_coercion=False)
637
+
638
+ @classmethod
639
+ def underlying_key_aspect_type(cls) -> Type["MLFeatureTableKeyClass"]:
640
+ from datahub.metadata.schema_classes import MLFeatureTableKeyClass
641
+
642
+ return MLFeatureTableKeyClass
643
+
644
+ def to_key_aspect(self) -> "MLFeatureTableKeyClass":
645
+ from datahub.metadata.schema_classes import MLFeatureTableKeyClass
646
+
647
+ return MLFeatureTableKeyClass(platform=self.platform, name=self.name)
648
+
649
+ @classmethod
650
+ def from_key_aspect(cls, key_aspect: "MLFeatureTableKeyClass") -> "MlFeatureTableUrn":
651
+ return cls(platform=key_aspect.platform, name=key_aspect.name)
652
+
653
+ @property
654
+ def platform(self) -> str:
651
655
  return self.entity_ids[0]
652
656
 
657
+ @property
658
+ def name(self) -> str:
659
+ return self.entity_ids[1]
660
+
653
661
  if TYPE_CHECKING:
654
662
  from datahub.metadata.schema_classes import DataContractKeyClass
655
663
 
@@ -696,109 +704,103 @@ class DataContractUrn(_SpecificUrn):
696
704
  return self.entity_ids[0]
697
705
 
698
706
  if TYPE_CHECKING:
699
- from datahub.metadata.schema_classes import ContainerKeyClass
707
+ from datahub.metadata.schema_classes import DatasetKeyClass
700
708
 
701
- class ContainerUrn(_SpecificUrn):
702
- ENTITY_TYPE: ClassVar[str] = "container"
703
- URN_PARTS: ClassVar[int] = 1
709
+ class DatasetUrn(_SpecificUrn):
710
+ ENTITY_TYPE: ClassVar[str] = "dataset"
711
+ URN_PARTS: ClassVar[int] = 3
704
712
 
705
- def __init__(self, guid: str, *, _allow_coercion: bool = True) -> None:
713
+ def __init__(self, platform: str, name: str, env: str = "PROD", *, _allow_coercion: bool = True) -> None:
706
714
  if _allow_coercion:
707
715
  # Field coercion logic (if any is required).
708
- guid = UrnEncoder.encode_string(guid)
716
+ platform = DataPlatformUrn(platform).urn()
717
+ name = UrnEncoder.encode_string(name)
718
+ env = env.upper()
719
+ env = UrnEncoder.encode_string(env)
709
720
 
710
721
  # Validation logic.
711
- if not guid:
712
- raise InvalidUrnError("ContainerUrn guid cannot be empty")
713
- if UrnEncoder.contains_reserved_char(guid):
714
- raise InvalidUrnError(f'ContainerUrn guid contains reserved characters')
722
+ if not platform:
723
+ raise InvalidUrnError("DatasetUrn platform cannot be empty")
724
+ platform = str(platform)
725
+ assert DataPlatformUrn.from_string(platform)
726
+ if not name:
727
+ raise InvalidUrnError("DatasetUrn name cannot be empty")
728
+ if UrnEncoder.contains_reserved_char(name):
729
+ raise InvalidUrnError(f'DatasetUrn name contains reserved characters')
730
+ if not env:
731
+ raise InvalidUrnError("DatasetUrn env cannot be empty")
732
+ if UrnEncoder.contains_reserved_char(env):
733
+ raise InvalidUrnError(f'DatasetUrn env contains reserved characters')
715
734
 
716
- super().__init__(self.ENTITY_TYPE, [guid])
735
+ super().__init__(self.ENTITY_TYPE, [platform, name, env])
717
736
 
718
737
  @classmethod
719
- def _parse_ids(cls, entity_ids: List[str]) -> "ContainerUrn":
738
+ def _parse_ids(cls, entity_ids: List[str]) -> "DatasetUrn":
720
739
  if len(entity_ids) != cls.URN_PARTS:
721
- raise InvalidUrnError(f"ContainerUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
722
- return cls(guid=entity_ids[0], _allow_coercion=False)
740
+ raise InvalidUrnError(f"DatasetUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
741
+ return cls(platform=entity_ids[0], name=entity_ids[1], env=entity_ids[2], _allow_coercion=False)
723
742
 
724
743
  @classmethod
725
- def underlying_key_aspect_type(cls) -> Type["ContainerKeyClass"]:
726
- from datahub.metadata.schema_classes import ContainerKeyClass
744
+ def underlying_key_aspect_type(cls) -> Type["DatasetKeyClass"]:
745
+ from datahub.metadata.schema_classes import DatasetKeyClass
727
746
 
728
- return ContainerKeyClass
747
+ return DatasetKeyClass
729
748
 
730
- def to_key_aspect(self) -> "ContainerKeyClass":
731
- from datahub.metadata.schema_classes import ContainerKeyClass
749
+ def to_key_aspect(self) -> "DatasetKeyClass":
750
+ from datahub.metadata.schema_classes import DatasetKeyClass
732
751
 
733
- return ContainerKeyClass(guid=self.guid)
752
+ return DatasetKeyClass(platform=self.platform, name=self.name, origin=self.env)
734
753
 
735
754
  @classmethod
736
- def from_key_aspect(cls, key_aspect: "ContainerKeyClass") -> "ContainerUrn":
737
- return cls(guid=key_aspect.guid)
738
-
739
- @property
740
- def guid(self) -> str:
741
- return self.entity_ids[0]
742
-
743
- if TYPE_CHECKING:
744
- from datahub.metadata.schema_classes import DataHubRetentionKeyClass
745
-
746
- class DataHubRetentionUrn(_SpecificUrn):
747
- ENTITY_TYPE: ClassVar[str] = "dataHubRetention"
748
- URN_PARTS: ClassVar[int] = 2
749
-
750
- def __init__(self, entity_name: str, aspect_name: str, *, _allow_coercion: bool = True) -> None:
751
- if _allow_coercion:
752
- # Field coercion logic (if any is required).
753
- entity_name = UrnEncoder.encode_string(entity_name)
754
- aspect_name = UrnEncoder.encode_string(aspect_name)
755
-
756
- # Validation logic.
757
- if not entity_name:
758
- raise InvalidUrnError("DataHubRetentionUrn entity_name cannot be empty")
759
- if UrnEncoder.contains_reserved_char(entity_name):
760
- raise InvalidUrnError(f'DataHubRetentionUrn entity_name contains reserved characters')
761
- if not aspect_name:
762
- raise InvalidUrnError("DataHubRetentionUrn aspect_name cannot be empty")
763
- if UrnEncoder.contains_reserved_char(aspect_name):
764
- raise InvalidUrnError(f'DataHubRetentionUrn aspect_name contains reserved characters')
765
-
766
- super().__init__(self.ENTITY_TYPE, [entity_name, aspect_name])
755
+ def from_key_aspect(cls, key_aspect: "DatasetKeyClass") -> "DatasetUrn":
756
+ return cls(platform=key_aspect.platform, name=key_aspect.name, env=key_aspect.origin)
767
757
 
768
758
  @classmethod
769
- def _parse_ids(cls, entity_ids: List[str]) -> "DataHubRetentionUrn":
770
- if len(entity_ids) != cls.URN_PARTS:
771
- raise InvalidUrnError(f"DataHubRetentionUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
772
- return cls(entity_name=entity_ids[0], aspect_name=entity_ids[1], _allow_coercion=False)
759
+ def create_from_ids(
760
+ cls,
761
+ platform_id: str,
762
+ table_name: str,
763
+ env: str,
764
+ platform_instance: Optional[str] = None,
765
+ ) -> "DatasetUrn":
766
+ return DatasetUrn(
767
+ platform=platform_id,
768
+ name=f"{platform_instance}.{table_name}" if platform_instance else table_name,
769
+ env=env,
770
+ )
773
771
 
774
- @classmethod
775
- def underlying_key_aspect_type(cls) -> Type["DataHubRetentionKeyClass"]:
776
- from datahub.metadata.schema_classes import DataHubRetentionKeyClass
772
+ from datahub.utilities.urns.field_paths import get_simple_field_path_from_v2_field_path as _get_simple_field_path_from_v2_field_path
777
773
 
778
- return DataHubRetentionKeyClass
774
+ get_simple_field_path_from_v2_field_path = staticmethod(deprecated(reason='Use the function from the field_paths module instead')(_get_simple_field_path_from_v2_field_path))
779
775
 
780
- def to_key_aspect(self) -> "DataHubRetentionKeyClass":
781
- from datahub.metadata.schema_classes import DataHubRetentionKeyClass
776
+ def get_data_platform_urn(self) -> "DataPlatformUrn":
777
+ return DataPlatformUrn.from_string(self.platform)
782
778
 
783
- return DataHubRetentionKeyClass(entityName=self.entity_name, aspectName=self.aspect_name)
779
+ @deprecated(reason="Use .name instead")
780
+ def get_dataset_name(self) -> str:
781
+ return self.name
784
782
 
785
- @classmethod
786
- def from_key_aspect(cls, key_aspect: "DataHubRetentionKeyClass") -> "DataHubRetentionUrn":
787
- return cls(entity_name=key_aspect.entityName, aspect_name=key_aspect.aspectName)
783
+ @deprecated(reason="Use .env instead")
784
+ def get_env(self) -> str:
785
+ return self.env
788
786
 
789
787
  @property
790
- def entity_name(self) -> str:
788
+ def platform(self) -> str:
791
789
  return self.entity_ids[0]
792
790
 
793
791
  @property
794
- def aspect_name(self) -> str:
792
+ def name(self) -> str:
795
793
  return self.entity_ids[1]
796
794
 
795
+ @property
796
+ def env(self) -> str:
797
+ return self.entity_ids[2]
798
+
797
799
  if TYPE_CHECKING:
798
- from datahub.metadata.schema_classes import LinkPreviewKeyClass
800
+ from datahub.metadata.schema_classes import GlobalSettingsKeyClass
799
801
 
800
- class LinkPreviewUrn(_SpecificUrn):
801
- ENTITY_TYPE: ClassVar[str] = "linkPreview"
802
+ class GlobalSettingsUrn(_SpecificUrn):
803
+ ENTITY_TYPE: ClassVar[str] = "globalSettings"
802
804
  URN_PARTS: ClassVar[int] = 1
803
805
 
804
806
  def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
@@ -808,31 +810,31 @@ class LinkPreviewUrn(_SpecificUrn):
808
810
 
809
811
  # Validation logic.
810
812
  if not id:
811
- raise InvalidUrnError("LinkPreviewUrn id cannot be empty")
813
+ raise InvalidUrnError("GlobalSettingsUrn id cannot be empty")
812
814
  if UrnEncoder.contains_reserved_char(id):
813
- raise InvalidUrnError(f'LinkPreviewUrn id contains reserved characters')
815
+ raise InvalidUrnError(f'GlobalSettingsUrn id contains reserved characters')
814
816
 
815
817
  super().__init__(self.ENTITY_TYPE, [id])
816
818
 
817
819
  @classmethod
818
- def _parse_ids(cls, entity_ids: List[str]) -> "LinkPreviewUrn":
820
+ def _parse_ids(cls, entity_ids: List[str]) -> "GlobalSettingsUrn":
819
821
  if len(entity_ids) != cls.URN_PARTS:
820
- raise InvalidUrnError(f"LinkPreviewUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
822
+ raise InvalidUrnError(f"GlobalSettingsUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
821
823
  return cls(id=entity_ids[0], _allow_coercion=False)
822
824
 
823
825
  @classmethod
824
- def underlying_key_aspect_type(cls) -> Type["LinkPreviewKeyClass"]:
825
- from datahub.metadata.schema_classes import LinkPreviewKeyClass
826
+ def underlying_key_aspect_type(cls) -> Type["GlobalSettingsKeyClass"]:
827
+ from datahub.metadata.schema_classes import GlobalSettingsKeyClass
826
828
 
827
- return LinkPreviewKeyClass
829
+ return GlobalSettingsKeyClass
828
830
 
829
- def to_key_aspect(self) -> "LinkPreviewKeyClass":
830
- from datahub.metadata.schema_classes import LinkPreviewKeyClass
831
+ def to_key_aspect(self) -> "GlobalSettingsKeyClass":
832
+ from datahub.metadata.schema_classes import GlobalSettingsKeyClass
831
833
 
832
- return LinkPreviewKeyClass(id=self.id)
834
+ return GlobalSettingsKeyClass(id=self.id)
833
835
 
834
836
  @classmethod
835
- def from_key_aspect(cls, key_aspect: "LinkPreviewKeyClass") -> "LinkPreviewUrn":
837
+ def from_key_aspect(cls, key_aspect: "GlobalSettingsKeyClass") -> "GlobalSettingsUrn":
836
838
  return cls(id=key_aspect.id)
837
839
 
838
840
  @property
@@ -840,333 +842,286 @@ class LinkPreviewUrn(_SpecificUrn):
840
842
  return self.entity_ids[0]
841
843
 
842
844
  if TYPE_CHECKING:
843
- from datahub.metadata.schema_classes import PostKeyClass
845
+ from datahub.metadata.schema_classes import CorpGroupKeyClass
844
846
 
845
- class PostUrn(_SpecificUrn):
846
- ENTITY_TYPE: ClassVar[str] = "post"
847
+ class CorpGroupUrn(_SpecificUrn):
848
+ ENTITY_TYPE: ClassVar[str] = "corpGroup"
847
849
  URN_PARTS: ClassVar[int] = 1
848
850
 
849
- def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
851
+ def __init__(self, name: str, *, _allow_coercion: bool = True) -> None:
850
852
  if _allow_coercion:
851
853
  # Field coercion logic (if any is required).
852
- id = UrnEncoder.encode_string(id)
854
+ name = UrnEncoder.encode_string(name)
853
855
 
854
856
  # Validation logic.
855
- if not id:
856
- raise InvalidUrnError("PostUrn id cannot be empty")
857
- if UrnEncoder.contains_reserved_char(id):
858
- raise InvalidUrnError(f'PostUrn id contains reserved characters')
857
+ if not name:
858
+ raise InvalidUrnError("CorpGroupUrn name cannot be empty")
859
+ if UrnEncoder.contains_reserved_char(name):
860
+ raise InvalidUrnError(f'CorpGroupUrn name contains reserved characters')
859
861
 
860
- super().__init__(self.ENTITY_TYPE, [id])
862
+ super().__init__(self.ENTITY_TYPE, [name])
861
863
 
862
864
  @classmethod
863
- def _parse_ids(cls, entity_ids: List[str]) -> "PostUrn":
865
+ def _parse_ids(cls, entity_ids: List[str]) -> "CorpGroupUrn":
864
866
  if len(entity_ids) != cls.URN_PARTS:
865
- raise InvalidUrnError(f"PostUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
866
- return cls(id=entity_ids[0], _allow_coercion=False)
867
+ raise InvalidUrnError(f"CorpGroupUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
868
+ return cls(name=entity_ids[0], _allow_coercion=False)
867
869
 
868
870
  @classmethod
869
- def underlying_key_aspect_type(cls) -> Type["PostKeyClass"]:
870
- from datahub.metadata.schema_classes import PostKeyClass
871
+ def underlying_key_aspect_type(cls) -> Type["CorpGroupKeyClass"]:
872
+ from datahub.metadata.schema_classes import CorpGroupKeyClass
871
873
 
872
- return PostKeyClass
874
+ return CorpGroupKeyClass
873
875
 
874
- def to_key_aspect(self) -> "PostKeyClass":
875
- from datahub.metadata.schema_classes import PostKeyClass
876
+ def to_key_aspect(self) -> "CorpGroupKeyClass":
877
+ from datahub.metadata.schema_classes import CorpGroupKeyClass
876
878
 
877
- return PostKeyClass(id=self.id)
879
+ return CorpGroupKeyClass(name=self.name)
878
880
 
879
881
  @classmethod
880
- def from_key_aspect(cls, key_aspect: "PostKeyClass") -> "PostUrn":
881
- return cls(id=key_aspect.id)
882
+ def from_key_aspect(cls, key_aspect: "CorpGroupKeyClass") -> "CorpGroupUrn":
883
+ return cls(name=key_aspect.name)
884
+
885
+ @classmethod
886
+ @deprecated(reason="Use the constructor instead")
887
+ def create_from_id(cls, id: str) -> "CorpGroupUrn":
888
+ return cls(id)
882
889
 
883
890
  @property
884
- def id(self) -> str:
891
+ def name(self) -> str:
885
892
  return self.entity_ids[0]
886
893
 
887
894
  if TYPE_CHECKING:
888
- from datahub.metadata.schema_classes import DataHubSecretKeyClass
895
+ from datahub.metadata.schema_classes import SchemaFieldKeyClass
889
896
 
890
- class DataHubSecretUrn(_SpecificUrn):
891
- ENTITY_TYPE: ClassVar[str] = "dataHubSecret"
892
- URN_PARTS: ClassVar[int] = 1
897
+ class SchemaFieldUrn(_SpecificUrn):
898
+ ENTITY_TYPE: ClassVar[str] = "schemaField"
899
+ URN_PARTS: ClassVar[int] = 2
893
900
 
894
- def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
901
+ def __init__(self, parent: str, field_path: str, *, _allow_coercion: bool = True) -> None:
895
902
  if _allow_coercion:
896
903
  # Field coercion logic (if any is required).
897
- id = UrnEncoder.encode_string(id)
904
+ field_path = UrnEncoder.encode_string(field_path)
898
905
 
899
906
  # Validation logic.
900
- if not id:
901
- raise InvalidUrnError("DataHubSecretUrn id cannot be empty")
902
- if UrnEncoder.contains_reserved_char(id):
903
- raise InvalidUrnError(f'DataHubSecretUrn id contains reserved characters')
907
+ if not parent:
908
+ raise InvalidUrnError("SchemaFieldUrn parent cannot be empty")
909
+ parent = str(parent)
910
+ assert Urn.from_string(parent)
911
+ if not field_path:
912
+ raise InvalidUrnError("SchemaFieldUrn field_path cannot be empty")
913
+ if UrnEncoder.contains_reserved_char(field_path):
914
+ raise InvalidUrnError(f'SchemaFieldUrn field_path contains reserved characters')
904
915
 
905
- super().__init__(self.ENTITY_TYPE, [id])
916
+ super().__init__(self.ENTITY_TYPE, [parent, field_path])
906
917
 
907
918
  @classmethod
908
- def _parse_ids(cls, entity_ids: List[str]) -> "DataHubSecretUrn":
919
+ def _parse_ids(cls, entity_ids: List[str]) -> "SchemaFieldUrn":
909
920
  if len(entity_ids) != cls.URN_PARTS:
910
- raise InvalidUrnError(f"DataHubSecretUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
911
- return cls(id=entity_ids[0], _allow_coercion=False)
921
+ raise InvalidUrnError(f"SchemaFieldUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
922
+ return cls(parent=entity_ids[0], field_path=entity_ids[1], _allow_coercion=False)
912
923
 
913
924
  @classmethod
914
- def underlying_key_aspect_type(cls) -> Type["DataHubSecretKeyClass"]:
915
- from datahub.metadata.schema_classes import DataHubSecretKeyClass
925
+ def underlying_key_aspect_type(cls) -> Type["SchemaFieldKeyClass"]:
926
+ from datahub.metadata.schema_classes import SchemaFieldKeyClass
916
927
 
917
- return DataHubSecretKeyClass
928
+ return SchemaFieldKeyClass
918
929
 
919
- def to_key_aspect(self) -> "DataHubSecretKeyClass":
920
- from datahub.metadata.schema_classes import DataHubSecretKeyClass
930
+ def to_key_aspect(self) -> "SchemaFieldKeyClass":
931
+ from datahub.metadata.schema_classes import SchemaFieldKeyClass
921
932
 
922
- return DataHubSecretKeyClass(id=self.id)
933
+ return SchemaFieldKeyClass(parent=self.parent, fieldPath=self.field_path)
923
934
 
924
935
  @classmethod
925
- def from_key_aspect(cls, key_aspect: "DataHubSecretKeyClass") -> "DataHubSecretUrn":
926
- return cls(id=key_aspect.id)
936
+ def from_key_aspect(cls, key_aspect: "SchemaFieldKeyClass") -> "SchemaFieldUrn":
937
+ return cls(parent=key_aspect.parent, field_path=key_aspect.fieldPath)
927
938
 
928
939
  @property
929
- def id(self) -> str:
940
+ def parent(self) -> str:
930
941
  return self.entity_ids[0]
931
942
 
943
+ @property
944
+ def field_path(self) -> str:
945
+ return self.entity_ids[1]
946
+
932
947
  if TYPE_CHECKING:
933
- from datahub.metadata.schema_classes import DataHubStepStateKeyClass
948
+ from datahub.metadata.schema_classes import DataFlowKeyClass
934
949
 
935
- class DataHubStepStateUrn(_SpecificUrn):
936
- ENTITY_TYPE: ClassVar[str] = "dataHubStepState"
937
- URN_PARTS: ClassVar[int] = 1
950
+ class DataFlowUrn(_SpecificUrn):
951
+ ENTITY_TYPE: ClassVar[str] = "dataFlow"
952
+ URN_PARTS: ClassVar[int] = 3
938
953
 
939
- def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
954
+ def __init__(self, orchestrator: str, flow_id: str, cluster: str, *, _allow_coercion: bool = True) -> None:
940
955
  if _allow_coercion:
941
956
  # Field coercion logic (if any is required).
942
- id = UrnEncoder.encode_string(id)
957
+ orchestrator = UrnEncoder.encode_string(orchestrator)
958
+ flow_id = UrnEncoder.encode_string(flow_id)
959
+ cluster = UrnEncoder.encode_string(cluster)
943
960
 
944
961
  # Validation logic.
945
- if not id:
946
- raise InvalidUrnError("DataHubStepStateUrn id cannot be empty")
947
- if UrnEncoder.contains_reserved_char(id):
948
- raise InvalidUrnError(f'DataHubStepStateUrn id contains reserved characters')
962
+ if not orchestrator:
963
+ raise InvalidUrnError("DataFlowUrn orchestrator cannot be empty")
964
+ if UrnEncoder.contains_reserved_char(orchestrator):
965
+ raise InvalidUrnError(f'DataFlowUrn orchestrator contains reserved characters')
966
+ if not flow_id:
967
+ raise InvalidUrnError("DataFlowUrn flow_id cannot be empty")
968
+ if UrnEncoder.contains_reserved_char(flow_id):
969
+ raise InvalidUrnError(f'DataFlowUrn flow_id contains reserved characters')
970
+ if not cluster:
971
+ raise InvalidUrnError("DataFlowUrn cluster cannot be empty")
972
+ if UrnEncoder.contains_reserved_char(cluster):
973
+ raise InvalidUrnError(f'DataFlowUrn cluster contains reserved characters')
949
974
 
950
- super().__init__(self.ENTITY_TYPE, [id])
975
+ super().__init__(self.ENTITY_TYPE, [orchestrator, flow_id, cluster])
951
976
 
952
977
  @classmethod
953
- def _parse_ids(cls, entity_ids: List[str]) -> "DataHubStepStateUrn":
978
+ def _parse_ids(cls, entity_ids: List[str]) -> "DataFlowUrn":
954
979
  if len(entity_ids) != cls.URN_PARTS:
955
- raise InvalidUrnError(f"DataHubStepStateUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
956
- return cls(id=entity_ids[0], _allow_coercion=False)
980
+ raise InvalidUrnError(f"DataFlowUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
981
+ return cls(orchestrator=entity_ids[0], flow_id=entity_ids[1], cluster=entity_ids[2], _allow_coercion=False)
957
982
 
958
983
  @classmethod
959
- def underlying_key_aspect_type(cls) -> Type["DataHubStepStateKeyClass"]:
960
- from datahub.metadata.schema_classes import DataHubStepStateKeyClass
984
+ def underlying_key_aspect_type(cls) -> Type["DataFlowKeyClass"]:
985
+ from datahub.metadata.schema_classes import DataFlowKeyClass
961
986
 
962
- return DataHubStepStateKeyClass
987
+ return DataFlowKeyClass
963
988
 
964
- def to_key_aspect(self) -> "DataHubStepStateKeyClass":
965
- from datahub.metadata.schema_classes import DataHubStepStateKeyClass
989
+ def to_key_aspect(self) -> "DataFlowKeyClass":
990
+ from datahub.metadata.schema_classes import DataFlowKeyClass
966
991
 
967
- return DataHubStepStateKeyClass(id=self.id)
992
+ return DataFlowKeyClass(orchestrator=self.orchestrator, flowId=self.flow_id, cluster=self.cluster)
968
993
 
969
994
  @classmethod
970
- def from_key_aspect(cls, key_aspect: "DataHubStepStateKeyClass") -> "DataHubStepStateUrn":
971
- return cls(id=key_aspect.id)
995
+ def from_key_aspect(cls, key_aspect: "DataFlowKeyClass") -> "DataFlowUrn":
996
+ return cls(orchestrator=key_aspect.orchestrator, flow_id=key_aspect.flowId, cluster=key_aspect.cluster)
997
+
998
+ @classmethod
999
+ def create_from_ids(
1000
+ cls,
1001
+ orchestrator: str,
1002
+ flow_id: str,
1003
+ env: str,
1004
+ platform_instance: Optional[str] = None,
1005
+ ) -> "DataFlowUrn":
1006
+ return cls(
1007
+ orchestrator=orchestrator,
1008
+ flow_id=f"{platform_instance}.{flow_id}" if platform_instance else flow_id,
1009
+ cluster=env,
1010
+ )
1011
+
1012
+ @deprecated(reason="Use .orchestrator instead")
1013
+ def get_orchestrator_name(self) -> str:
1014
+ return self.orchestrator
1015
+
1016
+ @deprecated(reason="Use .flow_id instead")
1017
+ def get_flow_id(self) -> str:
1018
+ return self.flow_id
1019
+
1020
+ @deprecated(reason="Use .cluster instead")
1021
+ def get_env(self) -> str:
1022
+ return self.cluster
972
1023
 
973
1024
  @property
974
- def id(self) -> str:
1025
+ def orchestrator(self) -> str:
975
1026
  return self.entity_ids[0]
976
1027
 
1028
+ @property
1029
+ def flow_id(self) -> str:
1030
+ return self.entity_ids[1]
1031
+
1032
+ @property
1033
+ def cluster(self) -> str:
1034
+ return self.entity_ids[2]
1035
+
977
1036
  if TYPE_CHECKING:
978
- from datahub.metadata.schema_classes import OwnershipTypeKeyClass
1037
+ from datahub.metadata.schema_classes import TagKeyClass
979
1038
 
980
- class OwnershipTypeUrn(_SpecificUrn):
981
- ENTITY_TYPE: ClassVar[str] = "ownershipType"
1039
+ class TagUrn(_SpecificUrn):
1040
+ ENTITY_TYPE: ClassVar[str] = "tag"
982
1041
  URN_PARTS: ClassVar[int] = 1
983
1042
 
984
- def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
1043
+ def __init__(self, name: str, *, _allow_coercion: bool = True) -> None:
985
1044
  if _allow_coercion:
986
1045
  # Field coercion logic (if any is required).
987
- id = UrnEncoder.encode_string(id)
1046
+ name = UrnEncoder.encode_string(name)
988
1047
 
989
1048
  # Validation logic.
990
- if not id:
991
- raise InvalidUrnError("OwnershipTypeUrn id cannot be empty")
992
- if UrnEncoder.contains_reserved_char(id):
993
- raise InvalidUrnError(f'OwnershipTypeUrn id contains reserved characters')
1049
+ if not name:
1050
+ raise InvalidUrnError("TagUrn name cannot be empty")
1051
+ if UrnEncoder.contains_reserved_char(name):
1052
+ raise InvalidUrnError(f'TagUrn name contains reserved characters')
994
1053
 
995
- super().__init__(self.ENTITY_TYPE, [id])
1054
+ super().__init__(self.ENTITY_TYPE, [name])
996
1055
 
997
1056
  @classmethod
998
- def _parse_ids(cls, entity_ids: List[str]) -> "OwnershipTypeUrn":
1057
+ def _parse_ids(cls, entity_ids: List[str]) -> "TagUrn":
999
1058
  if len(entity_ids) != cls.URN_PARTS:
1000
- raise InvalidUrnError(f"OwnershipTypeUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1001
- return cls(id=entity_ids[0], _allow_coercion=False)
1059
+ raise InvalidUrnError(f"TagUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1060
+ return cls(name=entity_ids[0], _allow_coercion=False)
1002
1061
 
1003
1062
  @classmethod
1004
- def underlying_key_aspect_type(cls) -> Type["OwnershipTypeKeyClass"]:
1005
- from datahub.metadata.schema_classes import OwnershipTypeKeyClass
1063
+ def underlying_key_aspect_type(cls) -> Type["TagKeyClass"]:
1064
+ from datahub.metadata.schema_classes import TagKeyClass
1006
1065
 
1007
- return OwnershipTypeKeyClass
1066
+ return TagKeyClass
1008
1067
 
1009
- def to_key_aspect(self) -> "OwnershipTypeKeyClass":
1010
- from datahub.metadata.schema_classes import OwnershipTypeKeyClass
1068
+ def to_key_aspect(self) -> "TagKeyClass":
1069
+ from datahub.metadata.schema_classes import TagKeyClass
1011
1070
 
1012
- return OwnershipTypeKeyClass(id=self.id)
1071
+ return TagKeyClass(name=self.name)
1013
1072
 
1014
1073
  @classmethod
1015
- def from_key_aspect(cls, key_aspect: "OwnershipTypeKeyClass") -> "OwnershipTypeUrn":
1016
- return cls(id=key_aspect.id)
1074
+ def from_key_aspect(cls, key_aspect: "TagKeyClass") -> "TagUrn":
1075
+ return cls(name=key_aspect.name)
1076
+
1077
+ @classmethod
1078
+ @deprecated(reason="Use the constructor instead")
1079
+ def create_from_id(cls, id: str) -> "TagUrn":
1080
+ return cls(id)
1017
1081
 
1018
1082
  @property
1019
- def id(self) -> str:
1083
+ def name(self) -> str:
1020
1084
  return self.entity_ids[0]
1021
1085
 
1022
1086
  if TYPE_CHECKING:
1023
- from datahub.metadata.schema_classes import AssertionKeyClass
1087
+ from datahub.metadata.schema_classes import TestKeyClass
1024
1088
 
1025
- class AssertionUrn(_SpecificUrn):
1026
- ENTITY_TYPE: ClassVar[str] = "assertion"
1089
+ class TestUrn(_SpecificUrn):
1090
+ ENTITY_TYPE: ClassVar[str] = "test"
1027
1091
  URN_PARTS: ClassVar[int] = 1
1028
1092
 
1029
- def __init__(self, assertion_id: str, *, _allow_coercion: bool = True) -> None:
1093
+ def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
1030
1094
  if _allow_coercion:
1031
1095
  # Field coercion logic (if any is required).
1032
- assertion_id = UrnEncoder.encode_string(assertion_id)
1033
-
1034
- # Validation logic.
1035
- if not assertion_id:
1036
- raise InvalidUrnError("AssertionUrn assertion_id cannot be empty")
1037
- if UrnEncoder.contains_reserved_char(assertion_id):
1038
- raise InvalidUrnError(f'AssertionUrn assertion_id contains reserved characters')
1039
-
1040
- super().__init__(self.ENTITY_TYPE, [assertion_id])
1041
-
1042
- @classmethod
1043
- def _parse_ids(cls, entity_ids: List[str]) -> "AssertionUrn":
1044
- if len(entity_ids) != cls.URN_PARTS:
1045
- raise InvalidUrnError(f"AssertionUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1046
- return cls(assertion_id=entity_ids[0], _allow_coercion=False)
1047
-
1048
- @classmethod
1049
- def underlying_key_aspect_type(cls) -> Type["AssertionKeyClass"]:
1050
- from datahub.metadata.schema_classes import AssertionKeyClass
1051
-
1052
- return AssertionKeyClass
1053
-
1054
- def to_key_aspect(self) -> "AssertionKeyClass":
1055
- from datahub.metadata.schema_classes import AssertionKeyClass
1056
-
1057
- return AssertionKeyClass(assertionId=self.assertion_id)
1058
-
1059
- @classmethod
1060
- def from_key_aspect(cls, key_aspect: "AssertionKeyClass") -> "AssertionUrn":
1061
- return cls(assertion_id=key_aspect.assertionId)
1062
-
1063
- @property
1064
- def assertion_id(self) -> str:
1065
- return self.entity_ids[0]
1066
-
1067
- if TYPE_CHECKING:
1068
- from datahub.metadata.schema_classes import DataJobKeyClass
1069
-
1070
- class DataJobUrn(_SpecificUrn):
1071
- ENTITY_TYPE: ClassVar[str] = "dataJob"
1072
- URN_PARTS: ClassVar[int] = 2
1073
-
1074
- def __init__(self, flow: str, job_id: str, *, _allow_coercion: bool = True) -> None:
1075
- if _allow_coercion:
1076
- # Field coercion logic (if any is required).
1077
- job_id = UrnEncoder.encode_string(job_id)
1078
-
1079
- # Validation logic.
1080
- if not flow:
1081
- raise InvalidUrnError("DataJobUrn flow cannot be empty")
1082
- flow = str(flow)
1083
- assert DataFlowUrn.from_string(flow)
1084
- if not job_id:
1085
- raise InvalidUrnError("DataJobUrn job_id cannot be empty")
1086
- if UrnEncoder.contains_reserved_char(job_id):
1087
- raise InvalidUrnError(f'DataJobUrn job_id contains reserved characters')
1088
-
1089
- super().__init__(self.ENTITY_TYPE, [flow, job_id])
1090
-
1091
- @classmethod
1092
- def _parse_ids(cls, entity_ids: List[str]) -> "DataJobUrn":
1093
- if len(entity_ids) != cls.URN_PARTS:
1094
- raise InvalidUrnError(f"DataJobUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1095
- return cls(flow=entity_ids[0], job_id=entity_ids[1], _allow_coercion=False)
1096
-
1097
- @classmethod
1098
- def underlying_key_aspect_type(cls) -> Type["DataJobKeyClass"]:
1099
- from datahub.metadata.schema_classes import DataJobKeyClass
1100
-
1101
- return DataJobKeyClass
1102
-
1103
- def to_key_aspect(self) -> "DataJobKeyClass":
1104
- from datahub.metadata.schema_classes import DataJobKeyClass
1105
-
1106
- return DataJobKeyClass(flow=self.flow, jobId=self.job_id)
1107
-
1108
- @classmethod
1109
- def from_key_aspect(cls, key_aspect: "DataJobKeyClass") -> "DataJobUrn":
1110
- return cls(flow=key_aspect.flow, job_id=key_aspect.jobId)
1111
-
1112
- @classmethod
1113
- def create_from_ids(cls, data_flow_urn: str, job_id: str) -> "DataJobUrn":
1114
- return cls(data_flow_urn, job_id)
1115
-
1116
- def get_data_flow_urn(self) -> "DataFlowUrn":
1117
- return DataFlowUrn.from_string(self.flow)
1118
-
1119
- @deprecated(reason="Use .job_id instead")
1120
- def get_job_id(self) -> str:
1121
- return self.job_id
1122
-
1123
- @property
1124
- def flow(self) -> str:
1125
- return self.entity_ids[0]
1126
-
1127
- @property
1128
- def job_id(self) -> str:
1129
- return self.entity_ids[1]
1130
-
1131
- if TYPE_CHECKING:
1132
- from datahub.metadata.schema_classes import ExecutionRequestKeyClass
1133
-
1134
- class DataHubExecutionRequestUrn(_SpecificUrn):
1135
- ENTITY_TYPE: ClassVar[str] = "dataHubExecutionRequest"
1136
- URN_PARTS: ClassVar[int] = 1
1137
-
1138
- def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
1139
- if _allow_coercion:
1140
- # Field coercion logic (if any is required).
1141
- id = UrnEncoder.encode_string(id)
1096
+ id = UrnEncoder.encode_string(id)
1142
1097
 
1143
1098
  # Validation logic.
1144
1099
  if not id:
1145
- raise InvalidUrnError("DataHubExecutionRequestUrn id cannot be empty")
1100
+ raise InvalidUrnError("TestUrn id cannot be empty")
1146
1101
  if UrnEncoder.contains_reserved_char(id):
1147
- raise InvalidUrnError(f'DataHubExecutionRequestUrn id contains reserved characters')
1102
+ raise InvalidUrnError(f'TestUrn id contains reserved characters')
1148
1103
 
1149
1104
  super().__init__(self.ENTITY_TYPE, [id])
1150
1105
 
1151
1106
  @classmethod
1152
- def _parse_ids(cls, entity_ids: List[str]) -> "DataHubExecutionRequestUrn":
1107
+ def _parse_ids(cls, entity_ids: List[str]) -> "TestUrn":
1153
1108
  if len(entity_ids) != cls.URN_PARTS:
1154
- raise InvalidUrnError(f"DataHubExecutionRequestUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1109
+ raise InvalidUrnError(f"TestUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1155
1110
  return cls(id=entity_ids[0], _allow_coercion=False)
1156
1111
 
1157
1112
  @classmethod
1158
- def underlying_key_aspect_type(cls) -> Type["ExecutionRequestKeyClass"]:
1159
- from datahub.metadata.schema_classes import ExecutionRequestKeyClass
1113
+ def underlying_key_aspect_type(cls) -> Type["TestKeyClass"]:
1114
+ from datahub.metadata.schema_classes import TestKeyClass
1160
1115
 
1161
- return ExecutionRequestKeyClass
1116
+ return TestKeyClass
1162
1117
 
1163
- def to_key_aspect(self) -> "ExecutionRequestKeyClass":
1164
- from datahub.metadata.schema_classes import ExecutionRequestKeyClass
1118
+ def to_key_aspect(self) -> "TestKeyClass":
1119
+ from datahub.metadata.schema_classes import TestKeyClass
1165
1120
 
1166
- return ExecutionRequestKeyClass(id=self.id)
1121
+ return TestKeyClass(id=self.id)
1167
1122
 
1168
1123
  @classmethod
1169
- def from_key_aspect(cls, key_aspect: "ExecutionRequestKeyClass") -> "DataHubExecutionRequestUrn":
1124
+ def from_key_aspect(cls, key_aspect: "TestKeyClass") -> "TestUrn":
1170
1125
  return cls(id=key_aspect.id)
1171
1126
 
1172
1127
  @property
@@ -1174,10 +1129,10 @@ class DataHubExecutionRequestUrn(_SpecificUrn):
1174
1129
  return self.entity_ids[0]
1175
1130
 
1176
1131
  if TYPE_CHECKING:
1177
- from datahub.metadata.schema_classes import SubscriptionKeyClass
1132
+ from datahub.metadata.schema_classes import OwnershipTypeKeyClass
1178
1133
 
1179
- class SubscriptionUrn(_SpecificUrn):
1180
- ENTITY_TYPE: ClassVar[str] = "subscription"
1134
+ class OwnershipTypeUrn(_SpecificUrn):
1135
+ ENTITY_TYPE: ClassVar[str] = "ownershipType"
1181
1136
  URN_PARTS: ClassVar[int] = 1
1182
1137
 
1183
1138
  def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
@@ -1187,31 +1142,31 @@ class SubscriptionUrn(_SpecificUrn):
1187
1142
 
1188
1143
  # Validation logic.
1189
1144
  if not id:
1190
- raise InvalidUrnError("SubscriptionUrn id cannot be empty")
1145
+ raise InvalidUrnError("OwnershipTypeUrn id cannot be empty")
1191
1146
  if UrnEncoder.contains_reserved_char(id):
1192
- raise InvalidUrnError(f'SubscriptionUrn id contains reserved characters')
1147
+ raise InvalidUrnError(f'OwnershipTypeUrn id contains reserved characters')
1193
1148
 
1194
1149
  super().__init__(self.ENTITY_TYPE, [id])
1195
1150
 
1196
1151
  @classmethod
1197
- def _parse_ids(cls, entity_ids: List[str]) -> "SubscriptionUrn":
1152
+ def _parse_ids(cls, entity_ids: List[str]) -> "OwnershipTypeUrn":
1198
1153
  if len(entity_ids) != cls.URN_PARTS:
1199
- raise InvalidUrnError(f"SubscriptionUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1154
+ raise InvalidUrnError(f"OwnershipTypeUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1200
1155
  return cls(id=entity_ids[0], _allow_coercion=False)
1201
1156
 
1202
1157
  @classmethod
1203
- def underlying_key_aspect_type(cls) -> Type["SubscriptionKeyClass"]:
1204
- from datahub.metadata.schema_classes import SubscriptionKeyClass
1158
+ def underlying_key_aspect_type(cls) -> Type["OwnershipTypeKeyClass"]:
1159
+ from datahub.metadata.schema_classes import OwnershipTypeKeyClass
1205
1160
 
1206
- return SubscriptionKeyClass
1161
+ return OwnershipTypeKeyClass
1207
1162
 
1208
- def to_key_aspect(self) -> "SubscriptionKeyClass":
1209
- from datahub.metadata.schema_classes import SubscriptionKeyClass
1163
+ def to_key_aspect(self) -> "OwnershipTypeKeyClass":
1164
+ from datahub.metadata.schema_classes import OwnershipTypeKeyClass
1210
1165
 
1211
- return SubscriptionKeyClass(id=self.id)
1166
+ return OwnershipTypeKeyClass(id=self.id)
1212
1167
 
1213
1168
  @classmethod
1214
- def from_key_aspect(cls, key_aspect: "SubscriptionKeyClass") -> "SubscriptionUrn":
1169
+ def from_key_aspect(cls, key_aspect: "OwnershipTypeKeyClass") -> "OwnershipTypeUrn":
1215
1170
  return cls(id=key_aspect.id)
1216
1171
 
1217
1172
  @property
@@ -1219,10 +1174,10 @@ class SubscriptionUrn(_SpecificUrn):
1219
1174
  return self.entity_ids[0]
1220
1175
 
1221
1176
  if TYPE_CHECKING:
1222
- from datahub.metadata.schema_classes import TestKeyClass
1177
+ from datahub.metadata.schema_classes import ERModelRelationshipKeyClass
1223
1178
 
1224
- class TestUrn(_SpecificUrn):
1225
- ENTITY_TYPE: ClassVar[str] = "test"
1179
+ class ErModelRelationshipUrn(_SpecificUrn):
1180
+ ENTITY_TYPE: ClassVar[str] = "erModelRelationship"
1226
1181
  URN_PARTS: ClassVar[int] = 1
1227
1182
 
1228
1183
  def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
@@ -1232,31 +1187,31 @@ class TestUrn(_SpecificUrn):
1232
1187
 
1233
1188
  # Validation logic.
1234
1189
  if not id:
1235
- raise InvalidUrnError("TestUrn id cannot be empty")
1190
+ raise InvalidUrnError("ErModelRelationshipUrn id cannot be empty")
1236
1191
  if UrnEncoder.contains_reserved_char(id):
1237
- raise InvalidUrnError(f'TestUrn id contains reserved characters')
1192
+ raise InvalidUrnError(f'ErModelRelationshipUrn id contains reserved characters')
1238
1193
 
1239
1194
  super().__init__(self.ENTITY_TYPE, [id])
1240
1195
 
1241
1196
  @classmethod
1242
- def _parse_ids(cls, entity_ids: List[str]) -> "TestUrn":
1197
+ def _parse_ids(cls, entity_ids: List[str]) -> "ErModelRelationshipUrn":
1243
1198
  if len(entity_ids) != cls.URN_PARTS:
1244
- raise InvalidUrnError(f"TestUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1199
+ raise InvalidUrnError(f"ErModelRelationshipUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1245
1200
  return cls(id=entity_ids[0], _allow_coercion=False)
1246
1201
 
1247
1202
  @classmethod
1248
- def underlying_key_aspect_type(cls) -> Type["TestKeyClass"]:
1249
- from datahub.metadata.schema_classes import TestKeyClass
1203
+ def underlying_key_aspect_type(cls) -> Type["ERModelRelationshipKeyClass"]:
1204
+ from datahub.metadata.schema_classes import ERModelRelationshipKeyClass
1250
1205
 
1251
- return TestKeyClass
1206
+ return ERModelRelationshipKeyClass
1252
1207
 
1253
- def to_key_aspect(self) -> "TestKeyClass":
1254
- from datahub.metadata.schema_classes import TestKeyClass
1208
+ def to_key_aspect(self) -> "ERModelRelationshipKeyClass":
1209
+ from datahub.metadata.schema_classes import ERModelRelationshipKeyClass
1255
1210
 
1256
- return TestKeyClass(id=self.id)
1211
+ return ERModelRelationshipKeyClass(id=self.id)
1257
1212
 
1258
1213
  @classmethod
1259
- def from_key_aspect(cls, key_aspect: "TestKeyClass") -> "TestUrn":
1214
+ def from_key_aspect(cls, key_aspect: "ERModelRelationshipKeyClass") -> "ErModelRelationshipUrn":
1260
1215
  return cls(id=key_aspect.id)
1261
1216
 
1262
1217
  @property
@@ -1264,10 +1219,10 @@ class TestUrn(_SpecificUrn):
1264
1219
  return self.entity_ids[0]
1265
1220
 
1266
1221
  if TYPE_CHECKING:
1267
- from datahub.metadata.schema_classes import AnomalyKeyClass
1222
+ from datahub.metadata.schema_classes import SubscriptionKeyClass
1268
1223
 
1269
- class AnomalyUrn(_SpecificUrn):
1270
- ENTITY_TYPE: ClassVar[str] = "anomaly"
1224
+ class SubscriptionUrn(_SpecificUrn):
1225
+ ENTITY_TYPE: ClassVar[str] = "subscription"
1271
1226
  URN_PARTS: ClassVar[int] = 1
1272
1227
 
1273
1228
  def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
@@ -1277,31 +1232,31 @@ class AnomalyUrn(_SpecificUrn):
1277
1232
 
1278
1233
  # Validation logic.
1279
1234
  if not id:
1280
- raise InvalidUrnError("AnomalyUrn id cannot be empty")
1235
+ raise InvalidUrnError("SubscriptionUrn id cannot be empty")
1281
1236
  if UrnEncoder.contains_reserved_char(id):
1282
- raise InvalidUrnError(f'AnomalyUrn id contains reserved characters')
1237
+ raise InvalidUrnError(f'SubscriptionUrn id contains reserved characters')
1283
1238
 
1284
1239
  super().__init__(self.ENTITY_TYPE, [id])
1285
1240
 
1286
1241
  @classmethod
1287
- def _parse_ids(cls, entity_ids: List[str]) -> "AnomalyUrn":
1242
+ def _parse_ids(cls, entity_ids: List[str]) -> "SubscriptionUrn":
1288
1243
  if len(entity_ids) != cls.URN_PARTS:
1289
- raise InvalidUrnError(f"AnomalyUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1244
+ raise InvalidUrnError(f"SubscriptionUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1290
1245
  return cls(id=entity_ids[0], _allow_coercion=False)
1291
1246
 
1292
1247
  @classmethod
1293
- def underlying_key_aspect_type(cls) -> Type["AnomalyKeyClass"]:
1294
- from datahub.metadata.schema_classes import AnomalyKeyClass
1248
+ def underlying_key_aspect_type(cls) -> Type["SubscriptionKeyClass"]:
1249
+ from datahub.metadata.schema_classes import SubscriptionKeyClass
1295
1250
 
1296
- return AnomalyKeyClass
1251
+ return SubscriptionKeyClass
1297
1252
 
1298
- def to_key_aspect(self) -> "AnomalyKeyClass":
1299
- from datahub.metadata.schema_classes import AnomalyKeyClass
1253
+ def to_key_aspect(self) -> "SubscriptionKeyClass":
1254
+ from datahub.metadata.schema_classes import SubscriptionKeyClass
1300
1255
 
1301
- return AnomalyKeyClass(id=self.id)
1256
+ return SubscriptionKeyClass(id=self.id)
1302
1257
 
1303
1258
  @classmethod
1304
- def from_key_aspect(cls, key_aspect: "AnomalyKeyClass") -> "AnomalyUrn":
1259
+ def from_key_aspect(cls, key_aspect: "SubscriptionKeyClass") -> "SubscriptionUrn":
1305
1260
  return cls(id=key_aspect.id)
1306
1261
 
1307
1262
  @property
@@ -1309,10 +1264,10 @@ class AnomalyUrn(_SpecificUrn):
1309
1264
  return self.entity_ids[0]
1310
1265
 
1311
1266
  if TYPE_CHECKING:
1312
- from datahub.metadata.schema_classes import MLModelDeploymentKeyClass
1267
+ from datahub.metadata.schema_classes import MLModelGroupKeyClass
1313
1268
 
1314
- class MlModelDeploymentUrn(_SpecificUrn):
1315
- ENTITY_TYPE: ClassVar[str] = "mlModelDeployment"
1269
+ class MlModelGroupUrn(_SpecificUrn):
1270
+ ENTITY_TYPE: ClassVar[str] = "mlModelGroup"
1316
1271
  URN_PARTS: ClassVar[int] = 3
1317
1272
 
1318
1273
  def __init__(self, platform: str, name: str, env: str = "PROD", *, _allow_coercion: bool = True) -> None:
@@ -1325,39 +1280,39 @@ class MlModelDeploymentUrn(_SpecificUrn):
1325
1280
 
1326
1281
  # Validation logic.
1327
1282
  if not platform:
1328
- raise InvalidUrnError("MlModelDeploymentUrn platform cannot be empty")
1283
+ raise InvalidUrnError("MlModelGroupUrn platform cannot be empty")
1329
1284
  platform = str(platform)
1330
1285
  assert DataPlatformUrn.from_string(platform)
1331
1286
  if not name:
1332
- raise InvalidUrnError("MlModelDeploymentUrn name cannot be empty")
1287
+ raise InvalidUrnError("MlModelGroupUrn name cannot be empty")
1333
1288
  if UrnEncoder.contains_reserved_char(name):
1334
- raise InvalidUrnError(f'MlModelDeploymentUrn name contains reserved characters')
1289
+ raise InvalidUrnError(f'MlModelGroupUrn name contains reserved characters')
1335
1290
  if not env:
1336
- raise InvalidUrnError("MlModelDeploymentUrn env cannot be empty")
1291
+ raise InvalidUrnError("MlModelGroupUrn env cannot be empty")
1337
1292
  if UrnEncoder.contains_reserved_char(env):
1338
- raise InvalidUrnError(f'MlModelDeploymentUrn env contains reserved characters')
1293
+ raise InvalidUrnError(f'MlModelGroupUrn env contains reserved characters')
1339
1294
 
1340
1295
  super().__init__(self.ENTITY_TYPE, [platform, name, env])
1341
1296
 
1342
1297
  @classmethod
1343
- def _parse_ids(cls, entity_ids: List[str]) -> "MlModelDeploymentUrn":
1298
+ def _parse_ids(cls, entity_ids: List[str]) -> "MlModelGroupUrn":
1344
1299
  if len(entity_ids) != cls.URN_PARTS:
1345
- raise InvalidUrnError(f"MlModelDeploymentUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1300
+ raise InvalidUrnError(f"MlModelGroupUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1346
1301
  return cls(platform=entity_ids[0], name=entity_ids[1], env=entity_ids[2], _allow_coercion=False)
1347
1302
 
1348
1303
  @classmethod
1349
- def underlying_key_aspect_type(cls) -> Type["MLModelDeploymentKeyClass"]:
1350
- from datahub.metadata.schema_classes import MLModelDeploymentKeyClass
1304
+ def underlying_key_aspect_type(cls) -> Type["MLModelGroupKeyClass"]:
1305
+ from datahub.metadata.schema_classes import MLModelGroupKeyClass
1351
1306
 
1352
- return MLModelDeploymentKeyClass
1307
+ return MLModelGroupKeyClass
1353
1308
 
1354
- def to_key_aspect(self) -> "MLModelDeploymentKeyClass":
1355
- from datahub.metadata.schema_classes import MLModelDeploymentKeyClass
1309
+ def to_key_aspect(self) -> "MLModelGroupKeyClass":
1310
+ from datahub.metadata.schema_classes import MLModelGroupKeyClass
1356
1311
 
1357
- return MLModelDeploymentKeyClass(platform=self.platform, name=self.name, origin=self.env)
1312
+ return MLModelGroupKeyClass(platform=self.platform, name=self.name, origin=self.env)
1358
1313
 
1359
1314
  @classmethod
1360
- def from_key_aspect(cls, key_aspect: "MLModelDeploymentKeyClass") -> "MlModelDeploymentUrn":
1315
+ def from_key_aspect(cls, key_aspect: "MLModelGroupKeyClass") -> "MlModelGroupUrn":
1361
1316
  return cls(platform=key_aspect.platform, name=key_aspect.name, env=key_aspect.origin)
1362
1317
 
1363
1318
  @property
@@ -1373,63 +1328,63 @@ class MlModelDeploymentUrn(_SpecificUrn):
1373
1328
  return self.entity_ids[2]
1374
1329
 
1375
1330
  if TYPE_CHECKING:
1376
- from datahub.metadata.schema_classes import MLModelGroupKeyClass
1331
+ from datahub.metadata.schema_classes import DataProcessKeyClass
1377
1332
 
1378
- class MlModelGroupUrn(_SpecificUrn):
1379
- ENTITY_TYPE: ClassVar[str] = "mlModelGroup"
1333
+ class DataProcessUrn(_SpecificUrn):
1334
+ ENTITY_TYPE: ClassVar[str] = "dataProcess"
1380
1335
  URN_PARTS: ClassVar[int] = 3
1381
1336
 
1382
- def __init__(self, platform: str, name: str, env: str = "PROD", *, _allow_coercion: bool = True) -> None:
1337
+ def __init__(self, name: str, orchestrator: str, env: str = "PROD", *, _allow_coercion: bool = True) -> None:
1383
1338
  if _allow_coercion:
1384
1339
  # Field coercion logic (if any is required).
1385
- platform = DataPlatformUrn(platform).urn()
1386
1340
  name = UrnEncoder.encode_string(name)
1341
+ orchestrator = UrnEncoder.encode_string(orchestrator)
1387
1342
  env = env.upper()
1388
1343
  env = UrnEncoder.encode_string(env)
1389
1344
 
1390
1345
  # Validation logic.
1391
- if not platform:
1392
- raise InvalidUrnError("MlModelGroupUrn platform cannot be empty")
1393
- platform = str(platform)
1394
- assert DataPlatformUrn.from_string(platform)
1395
1346
  if not name:
1396
- raise InvalidUrnError("MlModelGroupUrn name cannot be empty")
1347
+ raise InvalidUrnError("DataProcessUrn name cannot be empty")
1397
1348
  if UrnEncoder.contains_reserved_char(name):
1398
- raise InvalidUrnError(f'MlModelGroupUrn name contains reserved characters')
1349
+ raise InvalidUrnError(f'DataProcessUrn name contains reserved characters')
1350
+ if not orchestrator:
1351
+ raise InvalidUrnError("DataProcessUrn orchestrator cannot be empty")
1352
+ if UrnEncoder.contains_reserved_char(orchestrator):
1353
+ raise InvalidUrnError(f'DataProcessUrn orchestrator contains reserved characters')
1399
1354
  if not env:
1400
- raise InvalidUrnError("MlModelGroupUrn env cannot be empty")
1355
+ raise InvalidUrnError("DataProcessUrn env cannot be empty")
1401
1356
  if UrnEncoder.contains_reserved_char(env):
1402
- raise InvalidUrnError(f'MlModelGroupUrn env contains reserved characters')
1357
+ raise InvalidUrnError(f'DataProcessUrn env contains reserved characters')
1403
1358
 
1404
- super().__init__(self.ENTITY_TYPE, [platform, name, env])
1359
+ super().__init__(self.ENTITY_TYPE, [name, orchestrator, env])
1405
1360
 
1406
1361
  @classmethod
1407
- def _parse_ids(cls, entity_ids: List[str]) -> "MlModelGroupUrn":
1362
+ def _parse_ids(cls, entity_ids: List[str]) -> "DataProcessUrn":
1408
1363
  if len(entity_ids) != cls.URN_PARTS:
1409
- raise InvalidUrnError(f"MlModelGroupUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1410
- return cls(platform=entity_ids[0], name=entity_ids[1], env=entity_ids[2], _allow_coercion=False)
1364
+ raise InvalidUrnError(f"DataProcessUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1365
+ return cls(name=entity_ids[0], orchestrator=entity_ids[1], env=entity_ids[2], _allow_coercion=False)
1411
1366
 
1412
1367
  @classmethod
1413
- def underlying_key_aspect_type(cls) -> Type["MLModelGroupKeyClass"]:
1414
- from datahub.metadata.schema_classes import MLModelGroupKeyClass
1368
+ def underlying_key_aspect_type(cls) -> Type["DataProcessKeyClass"]:
1369
+ from datahub.metadata.schema_classes import DataProcessKeyClass
1415
1370
 
1416
- return MLModelGroupKeyClass
1371
+ return DataProcessKeyClass
1417
1372
 
1418
- def to_key_aspect(self) -> "MLModelGroupKeyClass":
1419
- from datahub.metadata.schema_classes import MLModelGroupKeyClass
1373
+ def to_key_aspect(self) -> "DataProcessKeyClass":
1374
+ from datahub.metadata.schema_classes import DataProcessKeyClass
1420
1375
 
1421
- return MLModelGroupKeyClass(platform=self.platform, name=self.name, origin=self.env)
1376
+ return DataProcessKeyClass(name=self.name, orchestrator=self.orchestrator, origin=self.env)
1422
1377
 
1423
1378
  @classmethod
1424
- def from_key_aspect(cls, key_aspect: "MLModelGroupKeyClass") -> "MlModelGroupUrn":
1425
- return cls(platform=key_aspect.platform, name=key_aspect.name, env=key_aspect.origin)
1379
+ def from_key_aspect(cls, key_aspect: "DataProcessKeyClass") -> "DataProcessUrn":
1380
+ return cls(name=key_aspect.name, orchestrator=key_aspect.orchestrator, env=key_aspect.origin)
1426
1381
 
1427
1382
  @property
1428
- def platform(self) -> str:
1383
+ def name(self) -> str:
1429
1384
  return self.entity_ids[0]
1430
1385
 
1431
1386
  @property
1432
- def name(self) -> str:
1387
+ def orchestrator(self) -> str:
1433
1388
  return self.entity_ids[1]
1434
1389
 
1435
1390
  @property
@@ -1437,212 +1392,208 @@ class MlModelGroupUrn(_SpecificUrn):
1437
1392
  return self.entity_ids[2]
1438
1393
 
1439
1394
  if TYPE_CHECKING:
1440
- from datahub.metadata.schema_classes import RecommendationModuleKeyClass
1395
+ from datahub.metadata.schema_classes import GlossaryNodeKeyClass
1441
1396
 
1442
- class RecommendationModuleUrn(_SpecificUrn):
1443
- ENTITY_TYPE: ClassVar[str] = "recommendationModule"
1444
- URN_PARTS: ClassVar[int] = 2
1397
+ class GlossaryNodeUrn(_SpecificUrn):
1398
+ ENTITY_TYPE: ClassVar[str] = "glossaryNode"
1399
+ URN_PARTS: ClassVar[int] = 1
1445
1400
 
1446
- def __init__(self, module_id: str, identifier: str, *, _allow_coercion: bool = True) -> None:
1401
+ def __init__(self, name: str, *, _allow_coercion: bool = True) -> None:
1447
1402
  if _allow_coercion:
1448
1403
  # Field coercion logic (if any is required).
1449
- module_id = UrnEncoder.encode_string(module_id)
1450
- identifier = UrnEncoder.encode_string(identifier)
1404
+ name = UrnEncoder.encode_string(name)
1451
1405
 
1452
1406
  # Validation logic.
1453
- if not module_id:
1454
- raise InvalidUrnError("RecommendationModuleUrn module_id cannot be empty")
1455
- if UrnEncoder.contains_reserved_char(module_id):
1456
- raise InvalidUrnError(f'RecommendationModuleUrn module_id contains reserved characters')
1457
- if not identifier:
1458
- raise InvalidUrnError("RecommendationModuleUrn identifier cannot be empty")
1459
- if UrnEncoder.contains_reserved_char(identifier):
1460
- raise InvalidUrnError(f'RecommendationModuleUrn identifier contains reserved characters')
1407
+ if not name:
1408
+ raise InvalidUrnError("GlossaryNodeUrn name cannot be empty")
1409
+ if UrnEncoder.contains_reserved_char(name):
1410
+ raise InvalidUrnError(f'GlossaryNodeUrn name contains reserved characters')
1461
1411
 
1462
- super().__init__(self.ENTITY_TYPE, [module_id, identifier])
1412
+ super().__init__(self.ENTITY_TYPE, [name])
1463
1413
 
1464
1414
  @classmethod
1465
- def _parse_ids(cls, entity_ids: List[str]) -> "RecommendationModuleUrn":
1415
+ def _parse_ids(cls, entity_ids: List[str]) -> "GlossaryNodeUrn":
1466
1416
  if len(entity_ids) != cls.URN_PARTS:
1467
- raise InvalidUrnError(f"RecommendationModuleUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1468
- return cls(module_id=entity_ids[0], identifier=entity_ids[1], _allow_coercion=False)
1417
+ raise InvalidUrnError(f"GlossaryNodeUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1418
+ return cls(name=entity_ids[0], _allow_coercion=False)
1469
1419
 
1470
1420
  @classmethod
1471
- def underlying_key_aspect_type(cls) -> Type["RecommendationModuleKeyClass"]:
1472
- from datahub.metadata.schema_classes import RecommendationModuleKeyClass
1421
+ def underlying_key_aspect_type(cls) -> Type["GlossaryNodeKeyClass"]:
1422
+ from datahub.metadata.schema_classes import GlossaryNodeKeyClass
1473
1423
 
1474
- return RecommendationModuleKeyClass
1424
+ return GlossaryNodeKeyClass
1475
1425
 
1476
- def to_key_aspect(self) -> "RecommendationModuleKeyClass":
1477
- from datahub.metadata.schema_classes import RecommendationModuleKeyClass
1426
+ def to_key_aspect(self) -> "GlossaryNodeKeyClass":
1427
+ from datahub.metadata.schema_classes import GlossaryNodeKeyClass
1478
1428
 
1479
- return RecommendationModuleKeyClass(moduleId=self.module_id, identifier=self.identifier)
1429
+ return GlossaryNodeKeyClass(name=self.name)
1480
1430
 
1481
1431
  @classmethod
1482
- def from_key_aspect(cls, key_aspect: "RecommendationModuleKeyClass") -> "RecommendationModuleUrn":
1483
- return cls(module_id=key_aspect.moduleId, identifier=key_aspect.identifier)
1432
+ def from_key_aspect(cls, key_aspect: "GlossaryNodeKeyClass") -> "GlossaryNodeUrn":
1433
+ return cls(name=key_aspect.name)
1484
1434
 
1485
1435
  @property
1486
- def module_id(self) -> str:
1436
+ def name(self) -> str:
1487
1437
  return self.entity_ids[0]
1488
1438
 
1489
- @property
1490
- def identifier(self) -> str:
1491
- return self.entity_ids[1]
1492
-
1493
1439
  if TYPE_CHECKING:
1494
- from datahub.metadata.schema_classes import SchemaFieldKeyClass
1440
+ from datahub.metadata.schema_classes import DashboardKeyClass
1495
1441
 
1496
- class SchemaFieldUrn(_SpecificUrn):
1497
- ENTITY_TYPE: ClassVar[str] = "schemaField"
1442
+ class DashboardUrn(_SpecificUrn):
1443
+ ENTITY_TYPE: ClassVar[str] = "dashboard"
1498
1444
  URN_PARTS: ClassVar[int] = 2
1499
1445
 
1500
- def __init__(self, parent: str, field_path: str, *, _allow_coercion: bool = True) -> None:
1446
+ def __init__(self, dashboard_tool: str, dashboard_id: str, *, _allow_coercion: bool = True) -> None:
1501
1447
  if _allow_coercion:
1502
1448
  # Field coercion logic (if any is required).
1503
- field_path = UrnEncoder.encode_string(field_path)
1449
+ dashboard_tool = UrnEncoder.encode_string(dashboard_tool)
1450
+ dashboard_id = UrnEncoder.encode_string(dashboard_id)
1504
1451
 
1505
1452
  # Validation logic.
1506
- if not parent:
1507
- raise InvalidUrnError("SchemaFieldUrn parent cannot be empty")
1508
- parent = str(parent)
1509
- assert Urn.from_string(parent)
1510
- if not field_path:
1511
- raise InvalidUrnError("SchemaFieldUrn field_path cannot be empty")
1512
- if UrnEncoder.contains_reserved_char(field_path):
1513
- raise InvalidUrnError(f'SchemaFieldUrn field_path contains reserved characters')
1453
+ if not dashboard_tool:
1454
+ raise InvalidUrnError("DashboardUrn dashboard_tool cannot be empty")
1455
+ if UrnEncoder.contains_reserved_char(dashboard_tool):
1456
+ raise InvalidUrnError(f'DashboardUrn dashboard_tool contains reserved characters')
1457
+ if not dashboard_id:
1458
+ raise InvalidUrnError("DashboardUrn dashboard_id cannot be empty")
1459
+ if UrnEncoder.contains_reserved_char(dashboard_id):
1460
+ raise InvalidUrnError(f'DashboardUrn dashboard_id contains reserved characters')
1514
1461
 
1515
- super().__init__(self.ENTITY_TYPE, [parent, field_path])
1462
+ super().__init__(self.ENTITY_TYPE, [dashboard_tool, dashboard_id])
1516
1463
 
1517
1464
  @classmethod
1518
- def _parse_ids(cls, entity_ids: List[str]) -> "SchemaFieldUrn":
1465
+ def _parse_ids(cls, entity_ids: List[str]) -> "DashboardUrn":
1519
1466
  if len(entity_ids) != cls.URN_PARTS:
1520
- raise InvalidUrnError(f"SchemaFieldUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1521
- return cls(parent=entity_ids[0], field_path=entity_ids[1], _allow_coercion=False)
1467
+ raise InvalidUrnError(f"DashboardUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1468
+ return cls(dashboard_tool=entity_ids[0], dashboard_id=entity_ids[1], _allow_coercion=False)
1522
1469
 
1523
1470
  @classmethod
1524
- def underlying_key_aspect_type(cls) -> Type["SchemaFieldKeyClass"]:
1525
- from datahub.metadata.schema_classes import SchemaFieldKeyClass
1471
+ def underlying_key_aspect_type(cls) -> Type["DashboardKeyClass"]:
1472
+ from datahub.metadata.schema_classes import DashboardKeyClass
1526
1473
 
1527
- return SchemaFieldKeyClass
1474
+ return DashboardKeyClass
1528
1475
 
1529
- def to_key_aspect(self) -> "SchemaFieldKeyClass":
1530
- from datahub.metadata.schema_classes import SchemaFieldKeyClass
1476
+ def to_key_aspect(self) -> "DashboardKeyClass":
1477
+ from datahub.metadata.schema_classes import DashboardKeyClass
1531
1478
 
1532
- return SchemaFieldKeyClass(parent=self.parent, fieldPath=self.field_path)
1479
+ return DashboardKeyClass(dashboardTool=self.dashboard_tool, dashboardId=self.dashboard_id)
1533
1480
 
1534
1481
  @classmethod
1535
- def from_key_aspect(cls, key_aspect: "SchemaFieldKeyClass") -> "SchemaFieldUrn":
1536
- return cls(parent=key_aspect.parent, field_path=key_aspect.fieldPath)
1482
+ def from_key_aspect(cls, key_aspect: "DashboardKeyClass") -> "DashboardUrn":
1483
+ return cls(dashboard_tool=key_aspect.dashboardTool, dashboard_id=key_aspect.dashboardId)
1537
1484
 
1538
1485
  @property
1539
- def parent(self) -> str:
1486
+ def dashboard_tool(self) -> str:
1540
1487
  return self.entity_ids[0]
1541
1488
 
1542
1489
  @property
1543
- def field_path(self) -> str:
1490
+ def dashboard_id(self) -> str:
1544
1491
  return self.entity_ids[1]
1545
1492
 
1546
1493
  if TYPE_CHECKING:
1547
- from datahub.metadata.schema_classes import CorpGroupKeyClass
1494
+ from datahub.metadata.schema_classes import IncidentKeyClass
1548
1495
 
1549
- class CorpGroupUrn(_SpecificUrn):
1550
- ENTITY_TYPE: ClassVar[str] = "corpGroup"
1496
+ class IncidentUrn(_SpecificUrn):
1497
+ ENTITY_TYPE: ClassVar[str] = "incident"
1551
1498
  URN_PARTS: ClassVar[int] = 1
1552
1499
 
1553
- def __init__(self, name: str, *, _allow_coercion: bool = True) -> None:
1500
+ def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
1554
1501
  if _allow_coercion:
1555
1502
  # Field coercion logic (if any is required).
1556
- name = UrnEncoder.encode_string(name)
1503
+ id = UrnEncoder.encode_string(id)
1557
1504
 
1558
1505
  # Validation logic.
1559
- if not name:
1560
- raise InvalidUrnError("CorpGroupUrn name cannot be empty")
1561
- if UrnEncoder.contains_reserved_char(name):
1562
- raise InvalidUrnError(f'CorpGroupUrn name contains reserved characters')
1506
+ if not id:
1507
+ raise InvalidUrnError("IncidentUrn id cannot be empty")
1508
+ if UrnEncoder.contains_reserved_char(id):
1509
+ raise InvalidUrnError(f'IncidentUrn id contains reserved characters')
1563
1510
 
1564
- super().__init__(self.ENTITY_TYPE, [name])
1511
+ super().__init__(self.ENTITY_TYPE, [id])
1565
1512
 
1566
1513
  @classmethod
1567
- def _parse_ids(cls, entity_ids: List[str]) -> "CorpGroupUrn":
1514
+ def _parse_ids(cls, entity_ids: List[str]) -> "IncidentUrn":
1568
1515
  if len(entity_ids) != cls.URN_PARTS:
1569
- raise InvalidUrnError(f"CorpGroupUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1570
- return cls(name=entity_ids[0], _allow_coercion=False)
1516
+ raise InvalidUrnError(f"IncidentUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1517
+ return cls(id=entity_ids[0], _allow_coercion=False)
1571
1518
 
1572
1519
  @classmethod
1573
- def underlying_key_aspect_type(cls) -> Type["CorpGroupKeyClass"]:
1574
- from datahub.metadata.schema_classes import CorpGroupKeyClass
1575
-
1576
- return CorpGroupKeyClass
1520
+ def underlying_key_aspect_type(cls) -> Type["IncidentKeyClass"]:
1521
+ from datahub.metadata.schema_classes import IncidentKeyClass
1577
1522
 
1578
- def to_key_aspect(self) -> "CorpGroupKeyClass":
1579
- from datahub.metadata.schema_classes import CorpGroupKeyClass
1523
+ return IncidentKeyClass
1580
1524
 
1581
- return CorpGroupKeyClass(name=self.name)
1525
+ def to_key_aspect(self) -> "IncidentKeyClass":
1526
+ from datahub.metadata.schema_classes import IncidentKeyClass
1582
1527
 
1583
- @classmethod
1584
- def from_key_aspect(cls, key_aspect: "CorpGroupKeyClass") -> "CorpGroupUrn":
1585
- return cls(name=key_aspect.name)
1528
+ return IncidentKeyClass(id=self.id)
1586
1529
 
1587
1530
  @classmethod
1588
- @deprecated(reason="Use the constructor instead")
1589
- def create_from_id(cls, id: str) -> "CorpGroupUrn":
1590
- return cls(id)
1531
+ def from_key_aspect(cls, key_aspect: "IncidentKeyClass") -> "IncidentUrn":
1532
+ return cls(id=key_aspect.id)
1591
1533
 
1592
1534
  @property
1593
- def name(self) -> str:
1535
+ def id(self) -> str:
1594
1536
  return self.entity_ids[0]
1595
1537
 
1596
1538
  if TYPE_CHECKING:
1597
- from datahub.metadata.schema_classes import DataHubUpgradeKeyClass
1539
+ from datahub.metadata.schema_classes import MLPrimaryKeyKeyClass
1598
1540
 
1599
- class DataHubUpgradeUrn(_SpecificUrn):
1600
- ENTITY_TYPE: ClassVar[str] = "dataHubUpgrade"
1601
- URN_PARTS: ClassVar[int] = 1
1541
+ class MlPrimaryKeyUrn(_SpecificUrn):
1542
+ ENTITY_TYPE: ClassVar[str] = "mlPrimaryKey"
1543
+ URN_PARTS: ClassVar[int] = 2
1602
1544
 
1603
- def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
1545
+ def __init__(self, feature_namespace: str, name: str, *, _allow_coercion: bool = True) -> None:
1604
1546
  if _allow_coercion:
1605
1547
  # Field coercion logic (if any is required).
1606
- id = UrnEncoder.encode_string(id)
1548
+ feature_namespace = UrnEncoder.encode_string(feature_namespace)
1549
+ name = UrnEncoder.encode_string(name)
1607
1550
 
1608
1551
  # Validation logic.
1609
- if not id:
1610
- raise InvalidUrnError("DataHubUpgradeUrn id cannot be empty")
1611
- if UrnEncoder.contains_reserved_char(id):
1612
- raise InvalidUrnError(f'DataHubUpgradeUrn id contains reserved characters')
1552
+ if not feature_namespace:
1553
+ raise InvalidUrnError("MlPrimaryKeyUrn feature_namespace cannot be empty")
1554
+ if UrnEncoder.contains_reserved_char(feature_namespace):
1555
+ raise InvalidUrnError(f'MlPrimaryKeyUrn feature_namespace contains reserved characters')
1556
+ if not name:
1557
+ raise InvalidUrnError("MlPrimaryKeyUrn name cannot be empty")
1558
+ if UrnEncoder.contains_reserved_char(name):
1559
+ raise InvalidUrnError(f'MlPrimaryKeyUrn name contains reserved characters')
1613
1560
 
1614
- super().__init__(self.ENTITY_TYPE, [id])
1561
+ super().__init__(self.ENTITY_TYPE, [feature_namespace, name])
1615
1562
 
1616
1563
  @classmethod
1617
- def _parse_ids(cls, entity_ids: List[str]) -> "DataHubUpgradeUrn":
1564
+ def _parse_ids(cls, entity_ids: List[str]) -> "MlPrimaryKeyUrn":
1618
1565
  if len(entity_ids) != cls.URN_PARTS:
1619
- raise InvalidUrnError(f"DataHubUpgradeUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1620
- return cls(id=entity_ids[0], _allow_coercion=False)
1566
+ raise InvalidUrnError(f"MlPrimaryKeyUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1567
+ return cls(feature_namespace=entity_ids[0], name=entity_ids[1], _allow_coercion=False)
1621
1568
 
1622
1569
  @classmethod
1623
- def underlying_key_aspect_type(cls) -> Type["DataHubUpgradeKeyClass"]:
1624
- from datahub.metadata.schema_classes import DataHubUpgradeKeyClass
1570
+ def underlying_key_aspect_type(cls) -> Type["MLPrimaryKeyKeyClass"]:
1571
+ from datahub.metadata.schema_classes import MLPrimaryKeyKeyClass
1625
1572
 
1626
- return DataHubUpgradeKeyClass
1573
+ return MLPrimaryKeyKeyClass
1627
1574
 
1628
- def to_key_aspect(self) -> "DataHubUpgradeKeyClass":
1629
- from datahub.metadata.schema_classes import DataHubUpgradeKeyClass
1575
+ def to_key_aspect(self) -> "MLPrimaryKeyKeyClass":
1576
+ from datahub.metadata.schema_classes import MLPrimaryKeyKeyClass
1630
1577
 
1631
- return DataHubUpgradeKeyClass(id=self.id)
1578
+ return MLPrimaryKeyKeyClass(featureNamespace=self.feature_namespace, name=self.name)
1632
1579
 
1633
1580
  @classmethod
1634
- def from_key_aspect(cls, key_aspect: "DataHubUpgradeKeyClass") -> "DataHubUpgradeUrn":
1635
- return cls(id=key_aspect.id)
1581
+ def from_key_aspect(cls, key_aspect: "MLPrimaryKeyKeyClass") -> "MlPrimaryKeyUrn":
1582
+ return cls(feature_namespace=key_aspect.featureNamespace, name=key_aspect.name)
1636
1583
 
1637
1584
  @property
1638
- def id(self) -> str:
1585
+ def feature_namespace(self) -> str:
1639
1586
  return self.entity_ids[0]
1640
1587
 
1641
- if TYPE_CHECKING:
1642
- from datahub.metadata.schema_classes import GlobalSettingsKeyClass
1643
-
1644
- class GlobalSettingsUrn(_SpecificUrn):
1645
- ENTITY_TYPE: ClassVar[str] = "globalSettings"
1588
+ @property
1589
+ def name(self) -> str:
1590
+ return self.entity_ids[1]
1591
+
1592
+ if TYPE_CHECKING:
1593
+ from datahub.metadata.schema_classes import DataProcessInstanceKeyClass
1594
+
1595
+ class DataProcessInstanceUrn(_SpecificUrn):
1596
+ ENTITY_TYPE: ClassVar[str] = "dataProcessInstance"
1646
1597
  URN_PARTS: ClassVar[int] = 1
1647
1598
 
1648
1599
  def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
@@ -1652,96 +1603,96 @@ class GlobalSettingsUrn(_SpecificUrn):
1652
1603
 
1653
1604
  # Validation logic.
1654
1605
  if not id:
1655
- raise InvalidUrnError("GlobalSettingsUrn id cannot be empty")
1606
+ raise InvalidUrnError("DataProcessInstanceUrn id cannot be empty")
1656
1607
  if UrnEncoder.contains_reserved_char(id):
1657
- raise InvalidUrnError(f'GlobalSettingsUrn id contains reserved characters')
1608
+ raise InvalidUrnError(f'DataProcessInstanceUrn id contains reserved characters')
1658
1609
 
1659
1610
  super().__init__(self.ENTITY_TYPE, [id])
1660
1611
 
1661
1612
  @classmethod
1662
- def _parse_ids(cls, entity_ids: List[str]) -> "GlobalSettingsUrn":
1613
+ def _parse_ids(cls, entity_ids: List[str]) -> "DataProcessInstanceUrn":
1663
1614
  if len(entity_ids) != cls.URN_PARTS:
1664
- raise InvalidUrnError(f"GlobalSettingsUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1615
+ raise InvalidUrnError(f"DataProcessInstanceUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1665
1616
  return cls(id=entity_ids[0], _allow_coercion=False)
1666
1617
 
1667
1618
  @classmethod
1668
- def underlying_key_aspect_type(cls) -> Type["GlobalSettingsKeyClass"]:
1669
- from datahub.metadata.schema_classes import GlobalSettingsKeyClass
1619
+ def underlying_key_aspect_type(cls) -> Type["DataProcessInstanceKeyClass"]:
1620
+ from datahub.metadata.schema_classes import DataProcessInstanceKeyClass
1670
1621
 
1671
- return GlobalSettingsKeyClass
1622
+ return DataProcessInstanceKeyClass
1672
1623
 
1673
- def to_key_aspect(self) -> "GlobalSettingsKeyClass":
1674
- from datahub.metadata.schema_classes import GlobalSettingsKeyClass
1624
+ def to_key_aspect(self) -> "DataProcessInstanceKeyClass":
1625
+ from datahub.metadata.schema_classes import DataProcessInstanceKeyClass
1675
1626
 
1676
- return GlobalSettingsKeyClass(id=self.id)
1627
+ return DataProcessInstanceKeyClass(id=self.id)
1677
1628
 
1678
1629
  @classmethod
1679
- def from_key_aspect(cls, key_aspect: "GlobalSettingsKeyClass") -> "GlobalSettingsUrn":
1630
+ def from_key_aspect(cls, key_aspect: "DataProcessInstanceKeyClass") -> "DataProcessInstanceUrn":
1680
1631
  return cls(id=key_aspect.id)
1681
1632
 
1633
+ @classmethod
1634
+ @deprecated(reason="Use the constructor instead")
1635
+ def create_from_id(cls, id: str) -> "DataProcessInstanceUrn":
1636
+ return cls(id)
1637
+
1638
+ @deprecated(reason="Use .id instead")
1639
+ def get_dataprocessinstance_id(self) -> str:
1640
+ return self.id
1641
+
1682
1642
  @property
1683
1643
  def id(self) -> str:
1684
1644
  return self.entity_ids[0]
1685
1645
 
1686
1646
  if TYPE_CHECKING:
1687
- from datahub.metadata.schema_classes import MLFeatureTableKeyClass
1647
+ from datahub.metadata.schema_classes import ExecutionRequestKeyClass
1688
1648
 
1689
- class MlFeatureTableUrn(_SpecificUrn):
1690
- ENTITY_TYPE: ClassVar[str] = "mlFeatureTable"
1691
- URN_PARTS: ClassVar[int] = 2
1649
+ class DataHubExecutionRequestUrn(_SpecificUrn):
1650
+ ENTITY_TYPE: ClassVar[str] = "dataHubExecutionRequest"
1651
+ URN_PARTS: ClassVar[int] = 1
1692
1652
 
1693
- def __init__(self, platform: str, name: str, *, _allow_coercion: bool = True) -> None:
1653
+ def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
1694
1654
  if _allow_coercion:
1695
1655
  # Field coercion logic (if any is required).
1696
- platform = DataPlatformUrn(platform).urn()
1697
- name = UrnEncoder.encode_string(name)
1656
+ id = UrnEncoder.encode_string(id)
1698
1657
 
1699
1658
  # Validation logic.
1700
- if not platform:
1701
- raise InvalidUrnError("MlFeatureTableUrn platform cannot be empty")
1702
- platform = str(platform)
1703
- assert DataPlatformUrn.from_string(platform)
1704
- if not name:
1705
- raise InvalidUrnError("MlFeatureTableUrn name cannot be empty")
1706
- if UrnEncoder.contains_reserved_char(name):
1707
- raise InvalidUrnError(f'MlFeatureTableUrn name contains reserved characters')
1659
+ if not id:
1660
+ raise InvalidUrnError("DataHubExecutionRequestUrn id cannot be empty")
1661
+ if UrnEncoder.contains_reserved_char(id):
1662
+ raise InvalidUrnError(f'DataHubExecutionRequestUrn id contains reserved characters')
1708
1663
 
1709
- super().__init__(self.ENTITY_TYPE, [platform, name])
1664
+ super().__init__(self.ENTITY_TYPE, [id])
1710
1665
 
1711
1666
  @classmethod
1712
- def _parse_ids(cls, entity_ids: List[str]) -> "MlFeatureTableUrn":
1667
+ def _parse_ids(cls, entity_ids: List[str]) -> "DataHubExecutionRequestUrn":
1713
1668
  if len(entity_ids) != cls.URN_PARTS:
1714
- raise InvalidUrnError(f"MlFeatureTableUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1715
- return cls(platform=entity_ids[0], name=entity_ids[1], _allow_coercion=False)
1669
+ raise InvalidUrnError(f"DataHubExecutionRequestUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1670
+ return cls(id=entity_ids[0], _allow_coercion=False)
1716
1671
 
1717
1672
  @classmethod
1718
- def underlying_key_aspect_type(cls) -> Type["MLFeatureTableKeyClass"]:
1719
- from datahub.metadata.schema_classes import MLFeatureTableKeyClass
1673
+ def underlying_key_aspect_type(cls) -> Type["ExecutionRequestKeyClass"]:
1674
+ from datahub.metadata.schema_classes import ExecutionRequestKeyClass
1720
1675
 
1721
- return MLFeatureTableKeyClass
1676
+ return ExecutionRequestKeyClass
1722
1677
 
1723
- def to_key_aspect(self) -> "MLFeatureTableKeyClass":
1724
- from datahub.metadata.schema_classes import MLFeatureTableKeyClass
1678
+ def to_key_aspect(self) -> "ExecutionRequestKeyClass":
1679
+ from datahub.metadata.schema_classes import ExecutionRequestKeyClass
1725
1680
 
1726
- return MLFeatureTableKeyClass(platform=self.platform, name=self.name)
1681
+ return ExecutionRequestKeyClass(id=self.id)
1727
1682
 
1728
1683
  @classmethod
1729
- def from_key_aspect(cls, key_aspect: "MLFeatureTableKeyClass") -> "MlFeatureTableUrn":
1730
- return cls(platform=key_aspect.platform, name=key_aspect.name)
1684
+ def from_key_aspect(cls, key_aspect: "ExecutionRequestKeyClass") -> "DataHubExecutionRequestUrn":
1685
+ return cls(id=key_aspect.id)
1731
1686
 
1732
1687
  @property
1733
- def platform(self) -> str:
1688
+ def id(self) -> str:
1734
1689
  return self.entity_ids[0]
1735
1690
 
1736
- @property
1737
- def name(self) -> str:
1738
- return self.entity_ids[1]
1739
-
1740
1691
  if TYPE_CHECKING:
1741
- from datahub.metadata.schema_classes import DataHubPersonaKeyClass
1692
+ from datahub.metadata.schema_classes import ConstraintKeyClass
1742
1693
 
1743
- class DataHubPersonaUrn(_SpecificUrn):
1744
- ENTITY_TYPE: ClassVar[str] = "dataHubPersona"
1694
+ class ConstraintUrn(_SpecificUrn):
1695
+ ENTITY_TYPE: ClassVar[str] = "constraint"
1745
1696
  URN_PARTS: ClassVar[int] = 1
1746
1697
 
1747
1698
  def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
@@ -1751,31 +1702,31 @@ class DataHubPersonaUrn(_SpecificUrn):
1751
1702
 
1752
1703
  # Validation logic.
1753
1704
  if not id:
1754
- raise InvalidUrnError("DataHubPersonaUrn id cannot be empty")
1705
+ raise InvalidUrnError("ConstraintUrn id cannot be empty")
1755
1706
  if UrnEncoder.contains_reserved_char(id):
1756
- raise InvalidUrnError(f'DataHubPersonaUrn id contains reserved characters')
1707
+ raise InvalidUrnError(f'ConstraintUrn id contains reserved characters')
1757
1708
 
1758
1709
  super().__init__(self.ENTITY_TYPE, [id])
1759
1710
 
1760
1711
  @classmethod
1761
- def _parse_ids(cls, entity_ids: List[str]) -> "DataHubPersonaUrn":
1712
+ def _parse_ids(cls, entity_ids: List[str]) -> "ConstraintUrn":
1762
1713
  if len(entity_ids) != cls.URN_PARTS:
1763
- raise InvalidUrnError(f"DataHubPersonaUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1714
+ raise InvalidUrnError(f"ConstraintUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1764
1715
  return cls(id=entity_ids[0], _allow_coercion=False)
1765
1716
 
1766
1717
  @classmethod
1767
- def underlying_key_aspect_type(cls) -> Type["DataHubPersonaKeyClass"]:
1768
- from datahub.metadata.schema_classes import DataHubPersonaKeyClass
1718
+ def underlying_key_aspect_type(cls) -> Type["ConstraintKeyClass"]:
1719
+ from datahub.metadata.schema_classes import ConstraintKeyClass
1769
1720
 
1770
- return DataHubPersonaKeyClass
1721
+ return ConstraintKeyClass
1771
1722
 
1772
- def to_key_aspect(self) -> "DataHubPersonaKeyClass":
1773
- from datahub.metadata.schema_classes import DataHubPersonaKeyClass
1723
+ def to_key_aspect(self) -> "ConstraintKeyClass":
1724
+ from datahub.metadata.schema_classes import ConstraintKeyClass
1774
1725
 
1775
- return DataHubPersonaKeyClass(id=self.id)
1726
+ return ConstraintKeyClass(id=self.id)
1776
1727
 
1777
1728
  @classmethod
1778
- def from_key_aspect(cls, key_aspect: "DataHubPersonaKeyClass") -> "DataHubPersonaUrn":
1729
+ def from_key_aspect(cls, key_aspect: "ConstraintKeyClass") -> "ConstraintUrn":
1779
1730
  return cls(id=key_aspect.id)
1780
1731
 
1781
1732
  @property
@@ -1783,209 +1734,263 @@ class DataHubPersonaUrn(_SpecificUrn):
1783
1734
  return self.entity_ids[0]
1784
1735
 
1785
1736
  if TYPE_CHECKING:
1786
- from datahub.metadata.schema_classes import TagKeyClass
1737
+ from datahub.metadata.schema_classes import ChartKeyClass
1787
1738
 
1788
- class TagUrn(_SpecificUrn):
1789
- ENTITY_TYPE: ClassVar[str] = "tag"
1790
- URN_PARTS: ClassVar[int] = 1
1739
+ class ChartUrn(_SpecificUrn):
1740
+ ENTITY_TYPE: ClassVar[str] = "chart"
1741
+ URN_PARTS: ClassVar[int] = 2
1791
1742
 
1792
- def __init__(self, name: str, *, _allow_coercion: bool = True) -> None:
1743
+ def __init__(self, dashboard_tool: str, chart_id: str, *, _allow_coercion: bool = True) -> None:
1793
1744
  if _allow_coercion:
1794
1745
  # Field coercion logic (if any is required).
1795
- name = UrnEncoder.encode_string(name)
1746
+ dashboard_tool = UrnEncoder.encode_string(dashboard_tool)
1747
+ chart_id = UrnEncoder.encode_string(chart_id)
1796
1748
 
1797
1749
  # Validation logic.
1798
- if not name:
1799
- raise InvalidUrnError("TagUrn name cannot be empty")
1800
- if UrnEncoder.contains_reserved_char(name):
1801
- raise InvalidUrnError(f'TagUrn name contains reserved characters')
1750
+ if not dashboard_tool:
1751
+ raise InvalidUrnError("ChartUrn dashboard_tool cannot be empty")
1752
+ if UrnEncoder.contains_reserved_char(dashboard_tool):
1753
+ raise InvalidUrnError(f'ChartUrn dashboard_tool contains reserved characters')
1754
+ if not chart_id:
1755
+ raise InvalidUrnError("ChartUrn chart_id cannot be empty")
1756
+ if UrnEncoder.contains_reserved_char(chart_id):
1757
+ raise InvalidUrnError(f'ChartUrn chart_id contains reserved characters')
1802
1758
 
1803
- super().__init__(self.ENTITY_TYPE, [name])
1759
+ super().__init__(self.ENTITY_TYPE, [dashboard_tool, chart_id])
1804
1760
 
1805
1761
  @classmethod
1806
- def _parse_ids(cls, entity_ids: List[str]) -> "TagUrn":
1762
+ def _parse_ids(cls, entity_ids: List[str]) -> "ChartUrn":
1807
1763
  if len(entity_ids) != cls.URN_PARTS:
1808
- raise InvalidUrnError(f"TagUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1809
- return cls(name=entity_ids[0], _allow_coercion=False)
1764
+ raise InvalidUrnError(f"ChartUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1765
+ return cls(dashboard_tool=entity_ids[0], chart_id=entity_ids[1], _allow_coercion=False)
1810
1766
 
1811
1767
  @classmethod
1812
- def underlying_key_aspect_type(cls) -> Type["TagKeyClass"]:
1813
- from datahub.metadata.schema_classes import TagKeyClass
1814
-
1815
- return TagKeyClass
1768
+ def underlying_key_aspect_type(cls) -> Type["ChartKeyClass"]:
1769
+ from datahub.metadata.schema_classes import ChartKeyClass
1816
1770
 
1817
- def to_key_aspect(self) -> "TagKeyClass":
1818
- from datahub.metadata.schema_classes import TagKeyClass
1771
+ return ChartKeyClass
1819
1772
 
1820
- return TagKeyClass(name=self.name)
1773
+ def to_key_aspect(self) -> "ChartKeyClass":
1774
+ from datahub.metadata.schema_classes import ChartKeyClass
1821
1775
 
1822
- @classmethod
1823
- def from_key_aspect(cls, key_aspect: "TagKeyClass") -> "TagUrn":
1824
- return cls(name=key_aspect.name)
1776
+ return ChartKeyClass(dashboardTool=self.dashboard_tool, chartId=self.chart_id)
1825
1777
 
1826
1778
  @classmethod
1827
- @deprecated(reason="Use the constructor instead")
1828
- def create_from_id(cls, id: str) -> "TagUrn":
1829
- return cls(id)
1779
+ def from_key_aspect(cls, key_aspect: "ChartKeyClass") -> "ChartUrn":
1780
+ return cls(dashboard_tool=key_aspect.dashboardTool, chart_id=key_aspect.chartId)
1830
1781
 
1831
1782
  @property
1832
- def name(self) -> str:
1783
+ def dashboard_tool(self) -> str:
1833
1784
  return self.entity_ids[0]
1834
1785
 
1786
+ @property
1787
+ def chart_id(self) -> str:
1788
+ return self.entity_ids[1]
1789
+
1835
1790
  if TYPE_CHECKING:
1836
- from datahub.metadata.schema_classes import ConstraintKeyClass
1791
+ from datahub.metadata.schema_classes import AssertionKeyClass
1837
1792
 
1838
- class ConstraintUrn(_SpecificUrn):
1839
- ENTITY_TYPE: ClassVar[str] = "constraint"
1793
+ class AssertionUrn(_SpecificUrn):
1794
+ ENTITY_TYPE: ClassVar[str] = "assertion"
1840
1795
  URN_PARTS: ClassVar[int] = 1
1841
1796
 
1842
- def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
1797
+ def __init__(self, assertion_id: str, *, _allow_coercion: bool = True) -> None:
1843
1798
  if _allow_coercion:
1844
1799
  # Field coercion logic (if any is required).
1845
- id = UrnEncoder.encode_string(id)
1800
+ assertion_id = UrnEncoder.encode_string(assertion_id)
1846
1801
 
1847
1802
  # Validation logic.
1848
- if not id:
1849
- raise InvalidUrnError("ConstraintUrn id cannot be empty")
1850
- if UrnEncoder.contains_reserved_char(id):
1851
- raise InvalidUrnError(f'ConstraintUrn id contains reserved characters')
1803
+ if not assertion_id:
1804
+ raise InvalidUrnError("AssertionUrn assertion_id cannot be empty")
1805
+ if UrnEncoder.contains_reserved_char(assertion_id):
1806
+ raise InvalidUrnError(f'AssertionUrn assertion_id contains reserved characters')
1852
1807
 
1853
- super().__init__(self.ENTITY_TYPE, [id])
1808
+ super().__init__(self.ENTITY_TYPE, [assertion_id])
1854
1809
 
1855
1810
  @classmethod
1856
- def _parse_ids(cls, entity_ids: List[str]) -> "ConstraintUrn":
1811
+ def _parse_ids(cls, entity_ids: List[str]) -> "AssertionUrn":
1857
1812
  if len(entity_ids) != cls.URN_PARTS:
1858
- raise InvalidUrnError(f"ConstraintUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1859
- return cls(id=entity_ids[0], _allow_coercion=False)
1813
+ raise InvalidUrnError(f"AssertionUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1814
+ return cls(assertion_id=entity_ids[0], _allow_coercion=False)
1860
1815
 
1861
1816
  @classmethod
1862
- def underlying_key_aspect_type(cls) -> Type["ConstraintKeyClass"]:
1863
- from datahub.metadata.schema_classes import ConstraintKeyClass
1817
+ def underlying_key_aspect_type(cls) -> Type["AssertionKeyClass"]:
1818
+ from datahub.metadata.schema_classes import AssertionKeyClass
1864
1819
 
1865
- return ConstraintKeyClass
1820
+ return AssertionKeyClass
1866
1821
 
1867
- def to_key_aspect(self) -> "ConstraintKeyClass":
1868
- from datahub.metadata.schema_classes import ConstraintKeyClass
1822
+ def to_key_aspect(self) -> "AssertionKeyClass":
1823
+ from datahub.metadata.schema_classes import AssertionKeyClass
1869
1824
 
1870
- return ConstraintKeyClass(id=self.id)
1825
+ return AssertionKeyClass(assertionId=self.assertion_id)
1871
1826
 
1872
1827
  @classmethod
1873
- def from_key_aspect(cls, key_aspect: "ConstraintKeyClass") -> "ConstraintUrn":
1874
- return cls(id=key_aspect.id)
1828
+ def from_key_aspect(cls, key_aspect: "AssertionKeyClass") -> "AssertionUrn":
1829
+ return cls(assertion_id=key_aspect.assertionId)
1875
1830
 
1876
1831
  @property
1877
- def id(self) -> str:
1832
+ def assertion_id(self) -> str:
1878
1833
  return self.entity_ids[0]
1879
1834
 
1880
1835
  if TYPE_CHECKING:
1881
- from datahub.metadata.schema_classes import CorpUserKeyClass
1836
+ from datahub.metadata.schema_classes import GlossaryTermKeyClass
1882
1837
 
1883
- class CorpUserUrn(_SpecificUrn):
1884
- ENTITY_TYPE: ClassVar[str] = "corpuser"
1838
+ class GlossaryTermUrn(_SpecificUrn):
1839
+ ENTITY_TYPE: ClassVar[str] = "glossaryTerm"
1885
1840
  URN_PARTS: ClassVar[int] = 1
1886
1841
 
1887
- def __init__(self, username: str, *, _allow_coercion: bool = True) -> None:
1842
+ def __init__(self, name: str, *, _allow_coercion: bool = True) -> None:
1888
1843
  if _allow_coercion:
1889
1844
  # Field coercion logic (if any is required).
1890
- username = UrnEncoder.encode_string(username)
1845
+ name = UrnEncoder.encode_string(name)
1891
1846
 
1892
1847
  # Validation logic.
1893
- if not username:
1894
- raise InvalidUrnError("CorpUserUrn username cannot be empty")
1895
- if UrnEncoder.contains_reserved_char(username):
1896
- raise InvalidUrnError(f'CorpUserUrn username contains reserved characters')
1848
+ if not name:
1849
+ raise InvalidUrnError("GlossaryTermUrn name cannot be empty")
1850
+ if UrnEncoder.contains_reserved_char(name):
1851
+ raise InvalidUrnError(f'GlossaryTermUrn name contains reserved characters')
1897
1852
 
1898
- super().__init__(self.ENTITY_TYPE, [username])
1853
+ super().__init__(self.ENTITY_TYPE, [name])
1899
1854
 
1900
1855
  @classmethod
1901
- def _parse_ids(cls, entity_ids: List[str]) -> "CorpUserUrn":
1856
+ def _parse_ids(cls, entity_ids: List[str]) -> "GlossaryTermUrn":
1902
1857
  if len(entity_ids) != cls.URN_PARTS:
1903
- raise InvalidUrnError(f"CorpUserUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1904
- return cls(username=entity_ids[0], _allow_coercion=False)
1858
+ raise InvalidUrnError(f"GlossaryTermUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1859
+ return cls(name=entity_ids[0], _allow_coercion=False)
1905
1860
 
1906
1861
  @classmethod
1907
- def underlying_key_aspect_type(cls) -> Type["CorpUserKeyClass"]:
1908
- from datahub.metadata.schema_classes import CorpUserKeyClass
1862
+ def underlying_key_aspect_type(cls) -> Type["GlossaryTermKeyClass"]:
1863
+ from datahub.metadata.schema_classes import GlossaryTermKeyClass
1909
1864
 
1910
- return CorpUserKeyClass
1865
+ return GlossaryTermKeyClass
1911
1866
 
1912
- def to_key_aspect(self) -> "CorpUserKeyClass":
1913
- from datahub.metadata.schema_classes import CorpUserKeyClass
1867
+ def to_key_aspect(self) -> "GlossaryTermKeyClass":
1868
+ from datahub.metadata.schema_classes import GlossaryTermKeyClass
1914
1869
 
1915
- return CorpUserKeyClass(username=self.username)
1870
+ return GlossaryTermKeyClass(name=self.name)
1916
1871
 
1917
1872
  @classmethod
1918
- def from_key_aspect(cls, key_aspect: "CorpUserKeyClass") -> "CorpUserUrn":
1919
- return cls(username=key_aspect.username)
1873
+ def from_key_aspect(cls, key_aspect: "GlossaryTermKeyClass") -> "GlossaryTermUrn":
1874
+ return cls(name=key_aspect.name)
1875
+
1876
+ @property
1877
+ def name(self) -> str:
1878
+ return self.entity_ids[0]
1879
+
1880
+ if TYPE_CHECKING:
1881
+ from datahub.metadata.schema_classes import RemoteExecutorKeyClass
1882
+
1883
+ class DataHubRemoteExecutorUrn(_SpecificUrn):
1884
+ ENTITY_TYPE: ClassVar[str] = "dataHubRemoteExecutor"
1885
+ URN_PARTS: ClassVar[int] = 1
1886
+
1887
+ def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
1888
+ if _allow_coercion:
1889
+ # Field coercion logic (if any is required).
1890
+ id = UrnEncoder.encode_string(id)
1891
+
1892
+ # Validation logic.
1893
+ if not id:
1894
+ raise InvalidUrnError("DataHubRemoteExecutorUrn id cannot be empty")
1895
+ if UrnEncoder.contains_reserved_char(id):
1896
+ raise InvalidUrnError(f'DataHubRemoteExecutorUrn id contains reserved characters')
1897
+
1898
+ super().__init__(self.ENTITY_TYPE, [id])
1920
1899
 
1921
1900
  @classmethod
1922
- @deprecated(reason="Use the constructor instead")
1923
- def create_from_id(cls, id: str) -> "CorpUserUrn":
1924
- return cls(id)
1901
+ def _parse_ids(cls, entity_ids: List[str]) -> "DataHubRemoteExecutorUrn":
1902
+ if len(entity_ids) != cls.URN_PARTS:
1903
+ raise InvalidUrnError(f"DataHubRemoteExecutorUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1904
+ return cls(id=entity_ids[0], _allow_coercion=False)
1905
+
1906
+ @classmethod
1907
+ def underlying_key_aspect_type(cls) -> Type["RemoteExecutorKeyClass"]:
1908
+ from datahub.metadata.schema_classes import RemoteExecutorKeyClass
1909
+
1910
+ return RemoteExecutorKeyClass
1911
+
1912
+ def to_key_aspect(self) -> "RemoteExecutorKeyClass":
1913
+ from datahub.metadata.schema_classes import RemoteExecutorKeyClass
1914
+
1915
+ return RemoteExecutorKeyClass(id=self.id)
1916
+
1917
+ @classmethod
1918
+ def from_key_aspect(cls, key_aspect: "RemoteExecutorKeyClass") -> "DataHubRemoteExecutorUrn":
1919
+ return cls(id=key_aspect.id)
1925
1920
 
1926
1921
  @property
1927
- def username(self) -> str:
1922
+ def id(self) -> str:
1928
1923
  return self.entity_ids[0]
1929
1924
 
1930
1925
  if TYPE_CHECKING:
1931
- from datahub.metadata.schema_classes import MLFeatureKeyClass
1926
+ from datahub.metadata.schema_classes import MLModelDeploymentKeyClass
1932
1927
 
1933
- class MlFeatureUrn(_SpecificUrn):
1934
- ENTITY_TYPE: ClassVar[str] = "mlFeature"
1935
- URN_PARTS: ClassVar[int] = 2
1928
+ class MlModelDeploymentUrn(_SpecificUrn):
1929
+ ENTITY_TYPE: ClassVar[str] = "mlModelDeployment"
1930
+ URN_PARTS: ClassVar[int] = 3
1936
1931
 
1937
- def __init__(self, feature_namespace: str, name: str, *, _allow_coercion: bool = True) -> None:
1932
+ def __init__(self, platform: str, name: str, env: str = "PROD", *, _allow_coercion: bool = True) -> None:
1938
1933
  if _allow_coercion:
1939
1934
  # Field coercion logic (if any is required).
1940
- feature_namespace = UrnEncoder.encode_string(feature_namespace)
1935
+ platform = DataPlatformUrn(platform).urn()
1941
1936
  name = UrnEncoder.encode_string(name)
1937
+ env = env.upper()
1938
+ env = UrnEncoder.encode_string(env)
1942
1939
 
1943
1940
  # Validation logic.
1944
- if not feature_namespace:
1945
- raise InvalidUrnError("MlFeatureUrn feature_namespace cannot be empty")
1946
- if UrnEncoder.contains_reserved_char(feature_namespace):
1947
- raise InvalidUrnError(f'MlFeatureUrn feature_namespace contains reserved characters')
1941
+ if not platform:
1942
+ raise InvalidUrnError("MlModelDeploymentUrn platform cannot be empty")
1943
+ platform = str(platform)
1944
+ assert DataPlatformUrn.from_string(platform)
1948
1945
  if not name:
1949
- raise InvalidUrnError("MlFeatureUrn name cannot be empty")
1946
+ raise InvalidUrnError("MlModelDeploymentUrn name cannot be empty")
1950
1947
  if UrnEncoder.contains_reserved_char(name):
1951
- raise InvalidUrnError(f'MlFeatureUrn name contains reserved characters')
1948
+ raise InvalidUrnError(f'MlModelDeploymentUrn name contains reserved characters')
1949
+ if not env:
1950
+ raise InvalidUrnError("MlModelDeploymentUrn env cannot be empty")
1951
+ if UrnEncoder.contains_reserved_char(env):
1952
+ raise InvalidUrnError(f'MlModelDeploymentUrn env contains reserved characters')
1952
1953
 
1953
- super().__init__(self.ENTITY_TYPE, [feature_namespace, name])
1954
+ super().__init__(self.ENTITY_TYPE, [platform, name, env])
1954
1955
 
1955
1956
  @classmethod
1956
- def _parse_ids(cls, entity_ids: List[str]) -> "MlFeatureUrn":
1957
+ def _parse_ids(cls, entity_ids: List[str]) -> "MlModelDeploymentUrn":
1957
1958
  if len(entity_ids) != cls.URN_PARTS:
1958
- raise InvalidUrnError(f"MlFeatureUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1959
- return cls(feature_namespace=entity_ids[0], name=entity_ids[1], _allow_coercion=False)
1959
+ raise InvalidUrnError(f"MlModelDeploymentUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
1960
+ return cls(platform=entity_ids[0], name=entity_ids[1], env=entity_ids[2], _allow_coercion=False)
1960
1961
 
1961
1962
  @classmethod
1962
- def underlying_key_aspect_type(cls) -> Type["MLFeatureKeyClass"]:
1963
- from datahub.metadata.schema_classes import MLFeatureKeyClass
1963
+ def underlying_key_aspect_type(cls) -> Type["MLModelDeploymentKeyClass"]:
1964
+ from datahub.metadata.schema_classes import MLModelDeploymentKeyClass
1964
1965
 
1965
- return MLFeatureKeyClass
1966
+ return MLModelDeploymentKeyClass
1966
1967
 
1967
- def to_key_aspect(self) -> "MLFeatureKeyClass":
1968
- from datahub.metadata.schema_classes import MLFeatureKeyClass
1968
+ def to_key_aspect(self) -> "MLModelDeploymentKeyClass":
1969
+ from datahub.metadata.schema_classes import MLModelDeploymentKeyClass
1969
1970
 
1970
- return MLFeatureKeyClass(featureNamespace=self.feature_namespace, name=self.name)
1971
+ return MLModelDeploymentKeyClass(platform=self.platform, name=self.name, origin=self.env)
1971
1972
 
1972
1973
  @classmethod
1973
- def from_key_aspect(cls, key_aspect: "MLFeatureKeyClass") -> "MlFeatureUrn":
1974
- return cls(feature_namespace=key_aspect.featureNamespace, name=key_aspect.name)
1974
+ def from_key_aspect(cls, key_aspect: "MLModelDeploymentKeyClass") -> "MlModelDeploymentUrn":
1975
+ return cls(platform=key_aspect.platform, name=key_aspect.name, env=key_aspect.origin)
1975
1976
 
1976
1977
  @property
1977
- def feature_namespace(self) -> str:
1978
+ def platform(self) -> str:
1978
1979
  return self.entity_ids[0]
1979
1980
 
1980
1981
  @property
1981
1982
  def name(self) -> str:
1982
1983
  return self.entity_ids[1]
1983
1984
 
1985
+ @property
1986
+ def env(self) -> str:
1987
+ return self.entity_ids[2]
1988
+
1984
1989
  if TYPE_CHECKING:
1985
- from datahub.metadata.schema_classes import IncidentKeyClass
1990
+ from datahub.metadata.schema_classes import DataHubConnectionKeyClass
1986
1991
 
1987
- class IncidentUrn(_SpecificUrn):
1988
- ENTITY_TYPE: ClassVar[str] = "incident"
1992
+ class DataHubConnectionUrn(_SpecificUrn):
1993
+ ENTITY_TYPE: ClassVar[str] = "dataHubConnection"
1989
1994
  URN_PARTS: ClassVar[int] = 1
1990
1995
 
1991
1996
  def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
@@ -1995,31 +2000,31 @@ class IncidentUrn(_SpecificUrn):
1995
2000
 
1996
2001
  # Validation logic.
1997
2002
  if not id:
1998
- raise InvalidUrnError("IncidentUrn id cannot be empty")
2003
+ raise InvalidUrnError("DataHubConnectionUrn id cannot be empty")
1999
2004
  if UrnEncoder.contains_reserved_char(id):
2000
- raise InvalidUrnError(f'IncidentUrn id contains reserved characters')
2005
+ raise InvalidUrnError(f'DataHubConnectionUrn id contains reserved characters')
2001
2006
 
2002
2007
  super().__init__(self.ENTITY_TYPE, [id])
2003
2008
 
2004
2009
  @classmethod
2005
- def _parse_ids(cls, entity_ids: List[str]) -> "IncidentUrn":
2010
+ def _parse_ids(cls, entity_ids: List[str]) -> "DataHubConnectionUrn":
2006
2011
  if len(entity_ids) != cls.URN_PARTS:
2007
- raise InvalidUrnError(f"IncidentUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2012
+ raise InvalidUrnError(f"DataHubConnectionUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2008
2013
  return cls(id=entity_ids[0], _allow_coercion=False)
2009
2014
 
2010
2015
  @classmethod
2011
- def underlying_key_aspect_type(cls) -> Type["IncidentKeyClass"]:
2012
- from datahub.metadata.schema_classes import IncidentKeyClass
2016
+ def underlying_key_aspect_type(cls) -> Type["DataHubConnectionKeyClass"]:
2017
+ from datahub.metadata.schema_classes import DataHubConnectionKeyClass
2013
2018
 
2014
- return IncidentKeyClass
2019
+ return DataHubConnectionKeyClass
2015
2020
 
2016
- def to_key_aspect(self) -> "IncidentKeyClass":
2017
- from datahub.metadata.schema_classes import IncidentKeyClass
2021
+ def to_key_aspect(self) -> "DataHubConnectionKeyClass":
2022
+ from datahub.metadata.schema_classes import DataHubConnectionKeyClass
2018
2023
 
2019
- return IncidentKeyClass(id=self.id)
2024
+ return DataHubConnectionKeyClass(id=self.id)
2020
2025
 
2021
2026
  @classmethod
2022
- def from_key_aspect(cls, key_aspect: "IncidentKeyClass") -> "IncidentUrn":
2027
+ def from_key_aspect(cls, key_aspect: "DataHubConnectionKeyClass") -> "DataHubConnectionUrn":
2023
2028
  return cls(id=key_aspect.id)
2024
2029
 
2025
2030
  @property
@@ -2027,10 +2032,10 @@ class IncidentUrn(_SpecificUrn):
2027
2032
  return self.entity_ids[0]
2028
2033
 
2029
2034
  if TYPE_CHECKING:
2030
- from datahub.metadata.schema_classes import DataProcessInstanceKeyClass
2035
+ from datahub.metadata.schema_classes import DataHubUpgradeKeyClass
2031
2036
 
2032
- class DataProcessInstanceUrn(_SpecificUrn):
2033
- ENTITY_TYPE: ClassVar[str] = "dataProcessInstance"
2037
+ class DataHubUpgradeUrn(_SpecificUrn):
2038
+ ENTITY_TYPE: ClassVar[str] = "dataHubUpgrade"
2034
2039
  URN_PARTS: ClassVar[int] = 1
2035
2040
 
2036
2041
  def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
@@ -2040,258 +2045,430 @@ class DataProcessInstanceUrn(_SpecificUrn):
2040
2045
 
2041
2046
  # Validation logic.
2042
2047
  if not id:
2043
- raise InvalidUrnError("DataProcessInstanceUrn id cannot be empty")
2048
+ raise InvalidUrnError("DataHubUpgradeUrn id cannot be empty")
2044
2049
  if UrnEncoder.contains_reserved_char(id):
2045
- raise InvalidUrnError(f'DataProcessInstanceUrn id contains reserved characters')
2050
+ raise InvalidUrnError(f'DataHubUpgradeUrn id contains reserved characters')
2046
2051
 
2047
2052
  super().__init__(self.ENTITY_TYPE, [id])
2048
2053
 
2049
2054
  @classmethod
2050
- def _parse_ids(cls, entity_ids: List[str]) -> "DataProcessInstanceUrn":
2055
+ def _parse_ids(cls, entity_ids: List[str]) -> "DataHubUpgradeUrn":
2051
2056
  if len(entity_ids) != cls.URN_PARTS:
2052
- raise InvalidUrnError(f"DataProcessInstanceUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2057
+ raise InvalidUrnError(f"DataHubUpgradeUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2053
2058
  return cls(id=entity_ids[0], _allow_coercion=False)
2054
2059
 
2055
2060
  @classmethod
2056
- def underlying_key_aspect_type(cls) -> Type["DataProcessInstanceKeyClass"]:
2057
- from datahub.metadata.schema_classes import DataProcessInstanceKeyClass
2061
+ def underlying_key_aspect_type(cls) -> Type["DataHubUpgradeKeyClass"]:
2062
+ from datahub.metadata.schema_classes import DataHubUpgradeKeyClass
2058
2063
 
2059
- return DataProcessInstanceKeyClass
2064
+ return DataHubUpgradeKeyClass
2060
2065
 
2061
- def to_key_aspect(self) -> "DataProcessInstanceKeyClass":
2062
- from datahub.metadata.schema_classes import DataProcessInstanceKeyClass
2066
+ def to_key_aspect(self) -> "DataHubUpgradeKeyClass":
2067
+ from datahub.metadata.schema_classes import DataHubUpgradeKeyClass
2063
2068
 
2064
- return DataProcessInstanceKeyClass(id=self.id)
2069
+ return DataHubUpgradeKeyClass(id=self.id)
2065
2070
 
2066
2071
  @classmethod
2067
- def from_key_aspect(cls, key_aspect: "DataProcessInstanceKeyClass") -> "DataProcessInstanceUrn":
2072
+ def from_key_aspect(cls, key_aspect: "DataHubUpgradeKeyClass") -> "DataHubUpgradeUrn":
2068
2073
  return cls(id=key_aspect.id)
2069
2074
 
2070
- @classmethod
2071
- @deprecated(reason="Use the constructor instead")
2072
- def create_from_id(cls, id: str) -> "DataProcessInstanceUrn":
2073
- return cls(id)
2074
-
2075
- @deprecated(reason="Use .id instead")
2076
- def get_dataprocessinstance_id(self) -> str:
2077
- return self.id
2078
-
2079
2075
  @property
2080
2076
  def id(self) -> str:
2081
2077
  return self.entity_ids[0]
2082
2078
 
2083
2079
  if TYPE_CHECKING:
2084
- from datahub.metadata.schema_classes import DataProcessKeyClass
2080
+ from datahub.metadata.schema_classes import DataHubViewKeyClass
2085
2081
 
2086
- class DataProcessUrn(_SpecificUrn):
2087
- ENTITY_TYPE: ClassVar[str] = "dataProcess"
2088
- URN_PARTS: ClassVar[int] = 3
2082
+ class DataHubViewUrn(_SpecificUrn):
2083
+ ENTITY_TYPE: ClassVar[str] = "dataHubView"
2084
+ URN_PARTS: ClassVar[int] = 1
2089
2085
 
2090
- def __init__(self, name: str, orchestrator: str, env: str = "PROD", *, _allow_coercion: bool = True) -> None:
2086
+ def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
2091
2087
  if _allow_coercion:
2092
2088
  # Field coercion logic (if any is required).
2093
- name = UrnEncoder.encode_string(name)
2094
- orchestrator = UrnEncoder.encode_string(orchestrator)
2095
- env = env.upper()
2096
- env = UrnEncoder.encode_string(env)
2089
+ id = UrnEncoder.encode_string(id)
2097
2090
 
2098
2091
  # Validation logic.
2099
- if not name:
2100
- raise InvalidUrnError("DataProcessUrn name cannot be empty")
2101
- if UrnEncoder.contains_reserved_char(name):
2102
- raise InvalidUrnError(f'DataProcessUrn name contains reserved characters')
2103
- if not orchestrator:
2104
- raise InvalidUrnError("DataProcessUrn orchestrator cannot be empty")
2105
- if UrnEncoder.contains_reserved_char(orchestrator):
2106
- raise InvalidUrnError(f'DataProcessUrn orchestrator contains reserved characters')
2107
- if not env:
2108
- raise InvalidUrnError("DataProcessUrn env cannot be empty")
2109
- if UrnEncoder.contains_reserved_char(env):
2110
- raise InvalidUrnError(f'DataProcessUrn env contains reserved characters')
2092
+ if not id:
2093
+ raise InvalidUrnError("DataHubViewUrn id cannot be empty")
2094
+ if UrnEncoder.contains_reserved_char(id):
2095
+ raise InvalidUrnError(f'DataHubViewUrn id contains reserved characters')
2111
2096
 
2112
- super().__init__(self.ENTITY_TYPE, [name, orchestrator, env])
2097
+ super().__init__(self.ENTITY_TYPE, [id])
2113
2098
 
2114
2099
  @classmethod
2115
- def _parse_ids(cls, entity_ids: List[str]) -> "DataProcessUrn":
2100
+ def _parse_ids(cls, entity_ids: List[str]) -> "DataHubViewUrn":
2116
2101
  if len(entity_ids) != cls.URN_PARTS:
2117
- raise InvalidUrnError(f"DataProcessUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2118
- return cls(name=entity_ids[0], orchestrator=entity_ids[1], env=entity_ids[2], _allow_coercion=False)
2102
+ raise InvalidUrnError(f"DataHubViewUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2103
+ return cls(id=entity_ids[0], _allow_coercion=False)
2119
2104
 
2120
2105
  @classmethod
2121
- def underlying_key_aspect_type(cls) -> Type["DataProcessKeyClass"]:
2122
- from datahub.metadata.schema_classes import DataProcessKeyClass
2106
+ def underlying_key_aspect_type(cls) -> Type["DataHubViewKeyClass"]:
2107
+ from datahub.metadata.schema_classes import DataHubViewKeyClass
2123
2108
 
2124
- return DataProcessKeyClass
2109
+ return DataHubViewKeyClass
2125
2110
 
2126
- def to_key_aspect(self) -> "DataProcessKeyClass":
2127
- from datahub.metadata.schema_classes import DataProcessKeyClass
2111
+ def to_key_aspect(self) -> "DataHubViewKeyClass":
2112
+ from datahub.metadata.schema_classes import DataHubViewKeyClass
2128
2113
 
2129
- return DataProcessKeyClass(name=self.name, orchestrator=self.orchestrator, origin=self.env)
2114
+ return DataHubViewKeyClass(id=self.id)
2130
2115
 
2131
2116
  @classmethod
2132
- def from_key_aspect(cls, key_aspect: "DataProcessKeyClass") -> "DataProcessUrn":
2133
- return cls(name=key_aspect.name, orchestrator=key_aspect.orchestrator, env=key_aspect.origin)
2117
+ def from_key_aspect(cls, key_aspect: "DataHubViewKeyClass") -> "DataHubViewUrn":
2118
+ return cls(id=key_aspect.id)
2134
2119
 
2135
2120
  @property
2136
- def name(self) -> str:
2121
+ def id(self) -> str:
2137
2122
  return self.entity_ids[0]
2138
2123
 
2139
- @property
2140
- def orchestrator(self) -> str:
2141
- return self.entity_ids[1]
2142
-
2143
- @property
2144
- def env(self) -> str:
2145
- return self.entity_ids[2]
2146
-
2147
2124
  if TYPE_CHECKING:
2148
- from datahub.metadata.schema_classes import DataFlowKeyClass
2125
+ from datahub.metadata.schema_classes import DataHubIngestionSourceKeyClass
2149
2126
 
2150
- class DataFlowUrn(_SpecificUrn):
2151
- ENTITY_TYPE: ClassVar[str] = "dataFlow"
2152
- URN_PARTS: ClassVar[int] = 3
2127
+ class DataHubIngestionSourceUrn(_SpecificUrn):
2128
+ ENTITY_TYPE: ClassVar[str] = "dataHubIngestionSource"
2129
+ URN_PARTS: ClassVar[int] = 1
2153
2130
 
2154
- def __init__(self, orchestrator: str, flow_id: str, cluster: str, *, _allow_coercion: bool = True) -> None:
2131
+ def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
2155
2132
  if _allow_coercion:
2156
2133
  # Field coercion logic (if any is required).
2157
- orchestrator = UrnEncoder.encode_string(orchestrator)
2158
- flow_id = UrnEncoder.encode_string(flow_id)
2159
- cluster = UrnEncoder.encode_string(cluster)
2134
+ id = UrnEncoder.encode_string(id)
2160
2135
 
2161
2136
  # Validation logic.
2162
- if not orchestrator:
2163
- raise InvalidUrnError("DataFlowUrn orchestrator cannot be empty")
2164
- if UrnEncoder.contains_reserved_char(orchestrator):
2165
- raise InvalidUrnError(f'DataFlowUrn orchestrator contains reserved characters')
2166
- if not flow_id:
2167
- raise InvalidUrnError("DataFlowUrn flow_id cannot be empty")
2168
- if UrnEncoder.contains_reserved_char(flow_id):
2169
- raise InvalidUrnError(f'DataFlowUrn flow_id contains reserved characters')
2170
- if not cluster:
2171
- raise InvalidUrnError("DataFlowUrn cluster cannot be empty")
2172
- if UrnEncoder.contains_reserved_char(cluster):
2173
- raise InvalidUrnError(f'DataFlowUrn cluster contains reserved characters')
2137
+ if not id:
2138
+ raise InvalidUrnError("DataHubIngestionSourceUrn id cannot be empty")
2139
+ if UrnEncoder.contains_reserved_char(id):
2140
+ raise InvalidUrnError(f'DataHubIngestionSourceUrn id contains reserved characters')
2174
2141
 
2175
- super().__init__(self.ENTITY_TYPE, [orchestrator, flow_id, cluster])
2142
+ super().__init__(self.ENTITY_TYPE, [id])
2176
2143
 
2177
2144
  @classmethod
2178
- def _parse_ids(cls, entity_ids: List[str]) -> "DataFlowUrn":
2145
+ def _parse_ids(cls, entity_ids: List[str]) -> "DataHubIngestionSourceUrn":
2179
2146
  if len(entity_ids) != cls.URN_PARTS:
2180
- raise InvalidUrnError(f"DataFlowUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2181
- return cls(orchestrator=entity_ids[0], flow_id=entity_ids[1], cluster=entity_ids[2], _allow_coercion=False)
2147
+ raise InvalidUrnError(f"DataHubIngestionSourceUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2148
+ return cls(id=entity_ids[0], _allow_coercion=False)
2182
2149
 
2183
2150
  @classmethod
2184
- def underlying_key_aspect_type(cls) -> Type["DataFlowKeyClass"]:
2185
- from datahub.metadata.schema_classes import DataFlowKeyClass
2151
+ def underlying_key_aspect_type(cls) -> Type["DataHubIngestionSourceKeyClass"]:
2152
+ from datahub.metadata.schema_classes import DataHubIngestionSourceKeyClass
2186
2153
 
2187
- return DataFlowKeyClass
2154
+ return DataHubIngestionSourceKeyClass
2188
2155
 
2189
- def to_key_aspect(self) -> "DataFlowKeyClass":
2190
- from datahub.metadata.schema_classes import DataFlowKeyClass
2156
+ def to_key_aspect(self) -> "DataHubIngestionSourceKeyClass":
2157
+ from datahub.metadata.schema_classes import DataHubIngestionSourceKeyClass
2191
2158
 
2192
- return DataFlowKeyClass(orchestrator=self.orchestrator, flowId=self.flow_id, cluster=self.cluster)
2159
+ return DataHubIngestionSourceKeyClass(id=self.id)
2193
2160
 
2194
2161
  @classmethod
2195
- def from_key_aspect(cls, key_aspect: "DataFlowKeyClass") -> "DataFlowUrn":
2196
- return cls(orchestrator=key_aspect.orchestrator, flow_id=key_aspect.flowId, cluster=key_aspect.cluster)
2162
+ def from_key_aspect(cls, key_aspect: "DataHubIngestionSourceKeyClass") -> "DataHubIngestionSourceUrn":
2163
+ return cls(id=key_aspect.id)
2164
+
2165
+ @property
2166
+ def id(self) -> str:
2167
+ return self.entity_ids[0]
2168
+
2169
+ if TYPE_CHECKING:
2170
+ from datahub.metadata.schema_classes import TelemetryKeyClass
2171
+
2172
+ class TelemetryUrn(_SpecificUrn):
2173
+ ENTITY_TYPE: ClassVar[str] = "telemetry"
2174
+ URN_PARTS: ClassVar[int] = 1
2175
+
2176
+ def __init__(self, name: str, *, _allow_coercion: bool = True) -> None:
2177
+ if _allow_coercion:
2178
+ # Field coercion logic (if any is required).
2179
+ name = UrnEncoder.encode_string(name)
2180
+
2181
+ # Validation logic.
2182
+ if not name:
2183
+ raise InvalidUrnError("TelemetryUrn name cannot be empty")
2184
+ if UrnEncoder.contains_reserved_char(name):
2185
+ raise InvalidUrnError(f'TelemetryUrn name contains reserved characters')
2186
+
2187
+ super().__init__(self.ENTITY_TYPE, [name])
2197
2188
 
2198
2189
  @classmethod
2199
- def create_from_ids(
2200
- cls,
2201
- orchestrator: str,
2202
- flow_id: str,
2203
- env: str,
2204
- platform_instance: Optional[str] = None,
2205
- ) -> "DataFlowUrn":
2206
- return cls(
2207
- orchestrator=orchestrator,
2208
- flow_id=f"{platform_instance}.{flow_id}" if platform_instance else flow_id,
2209
- cluster=env,
2210
- )
2190
+ def _parse_ids(cls, entity_ids: List[str]) -> "TelemetryUrn":
2191
+ if len(entity_ids) != cls.URN_PARTS:
2192
+ raise InvalidUrnError(f"TelemetryUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2193
+ return cls(name=entity_ids[0], _allow_coercion=False)
2211
2194
 
2212
- @deprecated(reason="Use .orchestrator instead")
2213
- def get_orchestrator_name(self) -> str:
2214
- return self.orchestrator
2195
+ @classmethod
2196
+ def underlying_key_aspect_type(cls) -> Type["TelemetryKeyClass"]:
2197
+ from datahub.metadata.schema_classes import TelemetryKeyClass
2215
2198
 
2216
- @deprecated(reason="Use .flow_id instead")
2217
- def get_flow_id(self) -> str:
2218
- return self.flow_id
2199
+ return TelemetryKeyClass
2219
2200
 
2220
- @deprecated(reason="Use .cluster instead")
2221
- def get_env(self) -> str:
2222
- return self.cluster
2201
+ def to_key_aspect(self) -> "TelemetryKeyClass":
2202
+ from datahub.metadata.schema_classes import TelemetryKeyClass
2203
+
2204
+ return TelemetryKeyClass(name=self.name)
2205
+
2206
+ @classmethod
2207
+ def from_key_aspect(cls, key_aspect: "TelemetryKeyClass") -> "TelemetryUrn":
2208
+ return cls(name=key_aspect.name)
2223
2209
 
2224
2210
  @property
2225
- def orchestrator(self) -> str:
2211
+ def name(self) -> str:
2226
2212
  return self.entity_ids[0]
2227
2213
 
2214
+ if TYPE_CHECKING:
2215
+ from datahub.metadata.schema_classes import DataHubActionKeyClass
2216
+
2217
+ class DataHubActionUrn(_SpecificUrn):
2218
+ ENTITY_TYPE: ClassVar[str] = "dataHubAction"
2219
+ URN_PARTS: ClassVar[int] = 1
2220
+
2221
+ def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
2222
+ if _allow_coercion:
2223
+ # Field coercion logic (if any is required).
2224
+ id = UrnEncoder.encode_string(id)
2225
+
2226
+ # Validation logic.
2227
+ if not id:
2228
+ raise InvalidUrnError("DataHubActionUrn id cannot be empty")
2229
+ if UrnEncoder.contains_reserved_char(id):
2230
+ raise InvalidUrnError(f'DataHubActionUrn id contains reserved characters')
2231
+
2232
+ super().__init__(self.ENTITY_TYPE, [id])
2233
+
2234
+ @classmethod
2235
+ def _parse_ids(cls, entity_ids: List[str]) -> "DataHubActionUrn":
2236
+ if len(entity_ids) != cls.URN_PARTS:
2237
+ raise InvalidUrnError(f"DataHubActionUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2238
+ return cls(id=entity_ids[0], _allow_coercion=False)
2239
+
2240
+ @classmethod
2241
+ def underlying_key_aspect_type(cls) -> Type["DataHubActionKeyClass"]:
2242
+ from datahub.metadata.schema_classes import DataHubActionKeyClass
2243
+
2244
+ return DataHubActionKeyClass
2245
+
2246
+ def to_key_aspect(self) -> "DataHubActionKeyClass":
2247
+ from datahub.metadata.schema_classes import DataHubActionKeyClass
2248
+
2249
+ return DataHubActionKeyClass(id=self.id)
2250
+
2251
+ @classmethod
2252
+ def from_key_aspect(cls, key_aspect: "DataHubActionKeyClass") -> "DataHubActionUrn":
2253
+ return cls(id=key_aspect.id)
2254
+
2228
2255
  @property
2229
- def flow_id(self) -> str:
2256
+ def id(self) -> str:
2257
+ return self.entity_ids[0]
2258
+
2259
+ if TYPE_CHECKING:
2260
+ from datahub.metadata.schema_classes import DataHubPolicyKeyClass
2261
+
2262
+ class DataHubPolicyUrn(_SpecificUrn):
2263
+ ENTITY_TYPE: ClassVar[str] = "dataHubPolicy"
2264
+ URN_PARTS: ClassVar[int] = 1
2265
+
2266
+ def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
2267
+ if _allow_coercion:
2268
+ # Field coercion logic (if any is required).
2269
+ id = UrnEncoder.encode_string(id)
2270
+
2271
+ # Validation logic.
2272
+ if not id:
2273
+ raise InvalidUrnError("DataHubPolicyUrn id cannot be empty")
2274
+ if UrnEncoder.contains_reserved_char(id):
2275
+ raise InvalidUrnError(f'DataHubPolicyUrn id contains reserved characters')
2276
+
2277
+ super().__init__(self.ENTITY_TYPE, [id])
2278
+
2279
+ @classmethod
2280
+ def _parse_ids(cls, entity_ids: List[str]) -> "DataHubPolicyUrn":
2281
+ if len(entity_ids) != cls.URN_PARTS:
2282
+ raise InvalidUrnError(f"DataHubPolicyUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2283
+ return cls(id=entity_ids[0], _allow_coercion=False)
2284
+
2285
+ @classmethod
2286
+ def underlying_key_aspect_type(cls) -> Type["DataHubPolicyKeyClass"]:
2287
+ from datahub.metadata.schema_classes import DataHubPolicyKeyClass
2288
+
2289
+ return DataHubPolicyKeyClass
2290
+
2291
+ def to_key_aspect(self) -> "DataHubPolicyKeyClass":
2292
+ from datahub.metadata.schema_classes import DataHubPolicyKeyClass
2293
+
2294
+ return DataHubPolicyKeyClass(id=self.id)
2295
+
2296
+ @classmethod
2297
+ def from_key_aspect(cls, key_aspect: "DataHubPolicyKeyClass") -> "DataHubPolicyUrn":
2298
+ return cls(id=key_aspect.id)
2299
+
2300
+ @property
2301
+ def id(self) -> str:
2302
+ return self.entity_ids[0]
2303
+
2304
+ if TYPE_CHECKING:
2305
+ from datahub.metadata.schema_classes import DataHubRetentionKeyClass
2306
+
2307
+ class DataHubRetentionUrn(_SpecificUrn):
2308
+ ENTITY_TYPE: ClassVar[str] = "dataHubRetention"
2309
+ URN_PARTS: ClassVar[int] = 2
2310
+
2311
+ def __init__(self, entity_name: str, aspect_name: str, *, _allow_coercion: bool = True) -> None:
2312
+ if _allow_coercion:
2313
+ # Field coercion logic (if any is required).
2314
+ entity_name = UrnEncoder.encode_string(entity_name)
2315
+ aspect_name = UrnEncoder.encode_string(aspect_name)
2316
+
2317
+ # Validation logic.
2318
+ if not entity_name:
2319
+ raise InvalidUrnError("DataHubRetentionUrn entity_name cannot be empty")
2320
+ if UrnEncoder.contains_reserved_char(entity_name):
2321
+ raise InvalidUrnError(f'DataHubRetentionUrn entity_name contains reserved characters')
2322
+ if not aspect_name:
2323
+ raise InvalidUrnError("DataHubRetentionUrn aspect_name cannot be empty")
2324
+ if UrnEncoder.contains_reserved_char(aspect_name):
2325
+ raise InvalidUrnError(f'DataHubRetentionUrn aspect_name contains reserved characters')
2326
+
2327
+ super().__init__(self.ENTITY_TYPE, [entity_name, aspect_name])
2328
+
2329
+ @classmethod
2330
+ def _parse_ids(cls, entity_ids: List[str]) -> "DataHubRetentionUrn":
2331
+ if len(entity_ids) != cls.URN_PARTS:
2332
+ raise InvalidUrnError(f"DataHubRetentionUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2333
+ return cls(entity_name=entity_ids[0], aspect_name=entity_ids[1], _allow_coercion=False)
2334
+
2335
+ @classmethod
2336
+ def underlying_key_aspect_type(cls) -> Type["DataHubRetentionKeyClass"]:
2337
+ from datahub.metadata.schema_classes import DataHubRetentionKeyClass
2338
+
2339
+ return DataHubRetentionKeyClass
2340
+
2341
+ def to_key_aspect(self) -> "DataHubRetentionKeyClass":
2342
+ from datahub.metadata.schema_classes import DataHubRetentionKeyClass
2343
+
2344
+ return DataHubRetentionKeyClass(entityName=self.entity_name, aspectName=self.aspect_name)
2345
+
2346
+ @classmethod
2347
+ def from_key_aspect(cls, key_aspect: "DataHubRetentionKeyClass") -> "DataHubRetentionUrn":
2348
+ return cls(entity_name=key_aspect.entityName, aspect_name=key_aspect.aspectName)
2349
+
2350
+ @property
2351
+ def entity_name(self) -> str:
2352
+ return self.entity_ids[0]
2353
+
2354
+ @property
2355
+ def aspect_name(self) -> str:
2230
2356
  return self.entity_ids[1]
2231
2357
 
2358
+ if TYPE_CHECKING:
2359
+ from datahub.metadata.schema_classes import FormKeyClass
2360
+
2361
+ class FormUrn(_SpecificUrn):
2362
+ ENTITY_TYPE: ClassVar[str] = "form"
2363
+ URN_PARTS: ClassVar[int] = 1
2364
+
2365
+ def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
2366
+ if _allow_coercion:
2367
+ # Field coercion logic (if any is required).
2368
+ id = UrnEncoder.encode_string(id)
2369
+
2370
+ # Validation logic.
2371
+ if not id:
2372
+ raise InvalidUrnError("FormUrn id cannot be empty")
2373
+ if UrnEncoder.contains_reserved_char(id):
2374
+ raise InvalidUrnError(f'FormUrn id contains reserved characters')
2375
+
2376
+ super().__init__(self.ENTITY_TYPE, [id])
2377
+
2378
+ @classmethod
2379
+ def _parse_ids(cls, entity_ids: List[str]) -> "FormUrn":
2380
+ if len(entity_ids) != cls.URN_PARTS:
2381
+ raise InvalidUrnError(f"FormUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2382
+ return cls(id=entity_ids[0], _allow_coercion=False)
2383
+
2384
+ @classmethod
2385
+ def underlying_key_aspect_type(cls) -> Type["FormKeyClass"]:
2386
+ from datahub.metadata.schema_classes import FormKeyClass
2387
+
2388
+ return FormKeyClass
2389
+
2390
+ def to_key_aspect(self) -> "FormKeyClass":
2391
+ from datahub.metadata.schema_classes import FormKeyClass
2392
+
2393
+ return FormKeyClass(id=self.id)
2394
+
2395
+ @classmethod
2396
+ def from_key_aspect(cls, key_aspect: "FormKeyClass") -> "FormUrn":
2397
+ return cls(id=key_aspect.id)
2398
+
2232
2399
  @property
2233
- def cluster(self) -> str:
2234
- return self.entity_ids[2]
2400
+ def id(self) -> str:
2401
+ return self.entity_ids[0]
2235
2402
 
2236
2403
  if TYPE_CHECKING:
2237
- from datahub.metadata.schema_classes import MLPrimaryKeyKeyClass
2404
+ from datahub.metadata.schema_classes import DataJobKeyClass
2238
2405
 
2239
- class MlPrimaryKeyUrn(_SpecificUrn):
2240
- ENTITY_TYPE: ClassVar[str] = "mlPrimaryKey"
2406
+ class DataJobUrn(_SpecificUrn):
2407
+ ENTITY_TYPE: ClassVar[str] = "dataJob"
2241
2408
  URN_PARTS: ClassVar[int] = 2
2242
2409
 
2243
- def __init__(self, feature_namespace: str, name: str, *, _allow_coercion: bool = True) -> None:
2410
+ def __init__(self, flow: str, job_id: str, *, _allow_coercion: bool = True) -> None:
2244
2411
  if _allow_coercion:
2245
2412
  # Field coercion logic (if any is required).
2246
- feature_namespace = UrnEncoder.encode_string(feature_namespace)
2247
- name = UrnEncoder.encode_string(name)
2413
+ job_id = UrnEncoder.encode_string(job_id)
2248
2414
 
2249
2415
  # Validation logic.
2250
- if not feature_namespace:
2251
- raise InvalidUrnError("MlPrimaryKeyUrn feature_namespace cannot be empty")
2252
- if UrnEncoder.contains_reserved_char(feature_namespace):
2253
- raise InvalidUrnError(f'MlPrimaryKeyUrn feature_namespace contains reserved characters')
2254
- if not name:
2255
- raise InvalidUrnError("MlPrimaryKeyUrn name cannot be empty")
2256
- if UrnEncoder.contains_reserved_char(name):
2257
- raise InvalidUrnError(f'MlPrimaryKeyUrn name contains reserved characters')
2416
+ if not flow:
2417
+ raise InvalidUrnError("DataJobUrn flow cannot be empty")
2418
+ flow = str(flow)
2419
+ assert DataFlowUrn.from_string(flow)
2420
+ if not job_id:
2421
+ raise InvalidUrnError("DataJobUrn job_id cannot be empty")
2422
+ if UrnEncoder.contains_reserved_char(job_id):
2423
+ raise InvalidUrnError(f'DataJobUrn job_id contains reserved characters')
2258
2424
 
2259
- super().__init__(self.ENTITY_TYPE, [feature_namespace, name])
2425
+ super().__init__(self.ENTITY_TYPE, [flow, job_id])
2260
2426
 
2261
2427
  @classmethod
2262
- def _parse_ids(cls, entity_ids: List[str]) -> "MlPrimaryKeyUrn":
2428
+ def _parse_ids(cls, entity_ids: List[str]) -> "DataJobUrn":
2263
2429
  if len(entity_ids) != cls.URN_PARTS:
2264
- raise InvalidUrnError(f"MlPrimaryKeyUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2265
- return cls(feature_namespace=entity_ids[0], name=entity_ids[1], _allow_coercion=False)
2430
+ raise InvalidUrnError(f"DataJobUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2431
+ return cls(flow=entity_ids[0], job_id=entity_ids[1], _allow_coercion=False)
2266
2432
 
2267
2433
  @classmethod
2268
- def underlying_key_aspect_type(cls) -> Type["MLPrimaryKeyKeyClass"]:
2269
- from datahub.metadata.schema_classes import MLPrimaryKeyKeyClass
2434
+ def underlying_key_aspect_type(cls) -> Type["DataJobKeyClass"]:
2435
+ from datahub.metadata.schema_classes import DataJobKeyClass
2270
2436
 
2271
- return MLPrimaryKeyKeyClass
2437
+ return DataJobKeyClass
2272
2438
 
2273
- def to_key_aspect(self) -> "MLPrimaryKeyKeyClass":
2274
- from datahub.metadata.schema_classes import MLPrimaryKeyKeyClass
2439
+ def to_key_aspect(self) -> "DataJobKeyClass":
2440
+ from datahub.metadata.schema_classes import DataJobKeyClass
2275
2441
 
2276
- return MLPrimaryKeyKeyClass(featureNamespace=self.feature_namespace, name=self.name)
2442
+ return DataJobKeyClass(flow=self.flow, jobId=self.job_id)
2277
2443
 
2278
2444
  @classmethod
2279
- def from_key_aspect(cls, key_aspect: "MLPrimaryKeyKeyClass") -> "MlPrimaryKeyUrn":
2280
- return cls(feature_namespace=key_aspect.featureNamespace, name=key_aspect.name)
2445
+ def from_key_aspect(cls, key_aspect: "DataJobKeyClass") -> "DataJobUrn":
2446
+ return cls(flow=key_aspect.flow, job_id=key_aspect.jobId)
2447
+
2448
+ @classmethod
2449
+ def create_from_ids(cls, data_flow_urn: str, job_id: str) -> "DataJobUrn":
2450
+ return cls(data_flow_urn, job_id)
2451
+
2452
+ def get_data_flow_urn(self) -> "DataFlowUrn":
2453
+ return DataFlowUrn.from_string(self.flow)
2454
+
2455
+ @deprecated(reason="Use .job_id instead")
2456
+ def get_job_id(self) -> str:
2457
+ return self.job_id
2281
2458
 
2282
2459
  @property
2283
- def feature_namespace(self) -> str:
2460
+ def flow(self) -> str:
2284
2461
  return self.entity_ids[0]
2285
2462
 
2286
2463
  @property
2287
- def name(self) -> str:
2464
+ def job_id(self) -> str:
2288
2465
  return self.entity_ids[1]
2289
2466
 
2290
2467
  if TYPE_CHECKING:
2291
- from datahub.metadata.schema_classes import DataHubAccessTokenKeyClass
2468
+ from datahub.metadata.schema_classes import AnomalyKeyClass
2292
2469
 
2293
- class DataHubAccessTokenUrn(_SpecificUrn):
2294
- ENTITY_TYPE: ClassVar[str] = "dataHubAccessToken"
2470
+ class AnomalyUrn(_SpecificUrn):
2471
+ ENTITY_TYPE: ClassVar[str] = "anomaly"
2295
2472
  URN_PARTS: ClassVar[int] = 1
2296
2473
 
2297
2474
  def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
@@ -2301,31 +2478,31 @@ class DataHubAccessTokenUrn(_SpecificUrn):
2301
2478
 
2302
2479
  # Validation logic.
2303
2480
  if not id:
2304
- raise InvalidUrnError("DataHubAccessTokenUrn id cannot be empty")
2481
+ raise InvalidUrnError("AnomalyUrn id cannot be empty")
2305
2482
  if UrnEncoder.contains_reserved_char(id):
2306
- raise InvalidUrnError(f'DataHubAccessTokenUrn id contains reserved characters')
2483
+ raise InvalidUrnError(f'AnomalyUrn id contains reserved characters')
2307
2484
 
2308
2485
  super().__init__(self.ENTITY_TYPE, [id])
2309
2486
 
2310
2487
  @classmethod
2311
- def _parse_ids(cls, entity_ids: List[str]) -> "DataHubAccessTokenUrn":
2488
+ def _parse_ids(cls, entity_ids: List[str]) -> "AnomalyUrn":
2312
2489
  if len(entity_ids) != cls.URN_PARTS:
2313
- raise InvalidUrnError(f"DataHubAccessTokenUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2490
+ raise InvalidUrnError(f"AnomalyUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2314
2491
  return cls(id=entity_ids[0], _allow_coercion=False)
2315
2492
 
2316
2493
  @classmethod
2317
- def underlying_key_aspect_type(cls) -> Type["DataHubAccessTokenKeyClass"]:
2318
- from datahub.metadata.schema_classes import DataHubAccessTokenKeyClass
2494
+ def underlying_key_aspect_type(cls) -> Type["AnomalyKeyClass"]:
2495
+ from datahub.metadata.schema_classes import AnomalyKeyClass
2319
2496
 
2320
- return DataHubAccessTokenKeyClass
2497
+ return AnomalyKeyClass
2321
2498
 
2322
- def to_key_aspect(self) -> "DataHubAccessTokenKeyClass":
2323
- from datahub.metadata.schema_classes import DataHubAccessTokenKeyClass
2499
+ def to_key_aspect(self) -> "AnomalyKeyClass":
2500
+ from datahub.metadata.schema_classes import AnomalyKeyClass
2324
2501
 
2325
- return DataHubAccessTokenKeyClass(id=self.id)
2502
+ return AnomalyKeyClass(id=self.id)
2326
2503
 
2327
2504
  @classmethod
2328
- def from_key_aspect(cls, key_aspect: "DataHubAccessTokenKeyClass") -> "DataHubAccessTokenUrn":
2505
+ def from_key_aspect(cls, key_aspect: "AnomalyKeyClass") -> "AnomalyUrn":
2329
2506
  return cls(id=key_aspect.id)
2330
2507
 
2331
2508
  @property
@@ -2333,254 +2510,217 @@ class DataHubAccessTokenUrn(_SpecificUrn):
2333
2510
  return self.entity_ids[0]
2334
2511
 
2335
2512
  if TYPE_CHECKING:
2336
- from datahub.metadata.schema_classes import DataPlatformKeyClass
2513
+ from datahub.metadata.schema_classes import MLFeatureKeyClass
2337
2514
 
2338
- class DataPlatformUrn(_SpecificUrn):
2339
- ENTITY_TYPE: ClassVar[str] = "dataPlatform"
2340
- URN_PARTS: ClassVar[int] = 1
2515
+ class MlFeatureUrn(_SpecificUrn):
2516
+ ENTITY_TYPE: ClassVar[str] = "mlFeature"
2517
+ URN_PARTS: ClassVar[int] = 2
2341
2518
 
2342
- def __init__(self, platform_name: str, *, _allow_coercion: bool = True) -> None:
2519
+ def __init__(self, feature_namespace: str, name: str, *, _allow_coercion: bool = True) -> None:
2343
2520
  if _allow_coercion:
2344
2521
  # Field coercion logic (if any is required).
2345
- if platform_name.startswith("urn:li:dataPlatform:"):
2346
- platform_name = DataPlatformUrn.from_string(platform_name).platform_name
2347
- platform_name = UrnEncoder.encode_string(platform_name)
2522
+ feature_namespace = UrnEncoder.encode_string(feature_namespace)
2523
+ name = UrnEncoder.encode_string(name)
2348
2524
 
2349
2525
  # Validation logic.
2350
- if not platform_name:
2351
- raise InvalidUrnError("DataPlatformUrn platform_name cannot be empty")
2352
- if UrnEncoder.contains_reserved_char(platform_name):
2353
- raise InvalidUrnError(f'DataPlatformUrn platform_name contains reserved characters')
2526
+ if not feature_namespace:
2527
+ raise InvalidUrnError("MlFeatureUrn feature_namespace cannot be empty")
2528
+ if UrnEncoder.contains_reserved_char(feature_namespace):
2529
+ raise InvalidUrnError(f'MlFeatureUrn feature_namespace contains reserved characters')
2530
+ if not name:
2531
+ raise InvalidUrnError("MlFeatureUrn name cannot be empty")
2532
+ if UrnEncoder.contains_reserved_char(name):
2533
+ raise InvalidUrnError(f'MlFeatureUrn name contains reserved characters')
2354
2534
 
2355
- super().__init__(self.ENTITY_TYPE, [platform_name])
2535
+ super().__init__(self.ENTITY_TYPE, [feature_namespace, name])
2356
2536
 
2357
2537
  @classmethod
2358
- def _parse_ids(cls, entity_ids: List[str]) -> "DataPlatformUrn":
2538
+ def _parse_ids(cls, entity_ids: List[str]) -> "MlFeatureUrn":
2359
2539
  if len(entity_ids) != cls.URN_PARTS:
2360
- raise InvalidUrnError(f"DataPlatformUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2361
- return cls(platform_name=entity_ids[0], _allow_coercion=False)
2540
+ raise InvalidUrnError(f"MlFeatureUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2541
+ return cls(feature_namespace=entity_ids[0], name=entity_ids[1], _allow_coercion=False)
2362
2542
 
2363
2543
  @classmethod
2364
- def underlying_key_aspect_type(cls) -> Type["DataPlatformKeyClass"]:
2365
- from datahub.metadata.schema_classes import DataPlatformKeyClass
2366
-
2367
- return DataPlatformKeyClass
2544
+ def underlying_key_aspect_type(cls) -> Type["MLFeatureKeyClass"]:
2545
+ from datahub.metadata.schema_classes import MLFeatureKeyClass
2368
2546
 
2369
- def to_key_aspect(self) -> "DataPlatformKeyClass":
2370
- from datahub.metadata.schema_classes import DataPlatformKeyClass
2547
+ return MLFeatureKeyClass
2371
2548
 
2372
- return DataPlatformKeyClass(platformName=self.platform_name)
2549
+ def to_key_aspect(self) -> "MLFeatureKeyClass":
2550
+ from datahub.metadata.schema_classes import MLFeatureKeyClass
2373
2551
 
2374
- @classmethod
2375
- def from_key_aspect(cls, key_aspect: "DataPlatformKeyClass") -> "DataPlatformUrn":
2376
- return cls(platform_name=key_aspect.platformName)
2552
+ return MLFeatureKeyClass(featureNamespace=self.feature_namespace, name=self.name)
2377
2553
 
2378
2554
  @classmethod
2379
- @deprecated(reason="Use the constructor instead")
2380
- def create_from_id(cls, id: str) -> "DataPlatformUrn":
2381
- return cls(id)
2555
+ def from_key_aspect(cls, key_aspect: "MLFeatureKeyClass") -> "MlFeatureUrn":
2556
+ return cls(feature_namespace=key_aspect.featureNamespace, name=key_aspect.name)
2382
2557
 
2383
2558
  @property
2384
- def platform_name(self) -> str:
2559
+ def feature_namespace(self) -> str:
2385
2560
  return self.entity_ids[0]
2386
2561
 
2562
+ @property
2563
+ def name(self) -> str:
2564
+ return self.entity_ids[1]
2565
+
2387
2566
  if TYPE_CHECKING:
2388
- from datahub.metadata.schema_classes import GlossaryTermKeyClass
2567
+ from datahub.metadata.schema_classes import ContainerKeyClass
2389
2568
 
2390
- class GlossaryTermUrn(_SpecificUrn):
2391
- ENTITY_TYPE: ClassVar[str] = "glossaryTerm"
2569
+ class ContainerUrn(_SpecificUrn):
2570
+ ENTITY_TYPE: ClassVar[str] = "container"
2392
2571
  URN_PARTS: ClassVar[int] = 1
2393
2572
 
2394
- def __init__(self, name: str, *, _allow_coercion: bool = True) -> None:
2573
+ def __init__(self, guid: str, *, _allow_coercion: bool = True) -> None:
2395
2574
  if _allow_coercion:
2396
2575
  # Field coercion logic (if any is required).
2397
- name = UrnEncoder.encode_string(name)
2576
+ guid = UrnEncoder.encode_string(guid)
2398
2577
 
2399
2578
  # Validation logic.
2400
- if not name:
2401
- raise InvalidUrnError("GlossaryTermUrn name cannot be empty")
2402
- if UrnEncoder.contains_reserved_char(name):
2403
- raise InvalidUrnError(f'GlossaryTermUrn name contains reserved characters')
2579
+ if not guid:
2580
+ raise InvalidUrnError("ContainerUrn guid cannot be empty")
2581
+ if UrnEncoder.contains_reserved_char(guid):
2582
+ raise InvalidUrnError(f'ContainerUrn guid contains reserved characters')
2404
2583
 
2405
- super().__init__(self.ENTITY_TYPE, [name])
2584
+ super().__init__(self.ENTITY_TYPE, [guid])
2406
2585
 
2407
2586
  @classmethod
2408
- def _parse_ids(cls, entity_ids: List[str]) -> "GlossaryTermUrn":
2587
+ def _parse_ids(cls, entity_ids: List[str]) -> "ContainerUrn":
2409
2588
  if len(entity_ids) != cls.URN_PARTS:
2410
- raise InvalidUrnError(f"GlossaryTermUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2411
- return cls(name=entity_ids[0], _allow_coercion=False)
2589
+ raise InvalidUrnError(f"ContainerUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2590
+ return cls(guid=entity_ids[0], _allow_coercion=False)
2412
2591
 
2413
2592
  @classmethod
2414
- def underlying_key_aspect_type(cls) -> Type["GlossaryTermKeyClass"]:
2415
- from datahub.metadata.schema_classes import GlossaryTermKeyClass
2593
+ def underlying_key_aspect_type(cls) -> Type["ContainerKeyClass"]:
2594
+ from datahub.metadata.schema_classes import ContainerKeyClass
2416
2595
 
2417
- return GlossaryTermKeyClass
2596
+ return ContainerKeyClass
2418
2597
 
2419
- def to_key_aspect(self) -> "GlossaryTermKeyClass":
2420
- from datahub.metadata.schema_classes import GlossaryTermKeyClass
2598
+ def to_key_aspect(self) -> "ContainerKeyClass":
2599
+ from datahub.metadata.schema_classes import ContainerKeyClass
2421
2600
 
2422
- return GlossaryTermKeyClass(name=self.name)
2601
+ return ContainerKeyClass(guid=self.guid)
2423
2602
 
2424
2603
  @classmethod
2425
- def from_key_aspect(cls, key_aspect: "GlossaryTermKeyClass") -> "GlossaryTermUrn":
2426
- return cls(name=key_aspect.name)
2604
+ def from_key_aspect(cls, key_aspect: "ContainerKeyClass") -> "ContainerUrn":
2605
+ return cls(guid=key_aspect.guid)
2427
2606
 
2428
2607
  @property
2429
- def name(self) -> str:
2608
+ def guid(self) -> str:
2430
2609
  return self.entity_ids[0]
2431
2610
 
2432
2611
  if TYPE_CHECKING:
2433
- from datahub.metadata.schema_classes import DatasetKeyClass
2612
+ from datahub.metadata.schema_classes import VersionSetKeyClass
2434
2613
 
2435
- class DatasetUrn(_SpecificUrn):
2436
- ENTITY_TYPE: ClassVar[str] = "dataset"
2437
- URN_PARTS: ClassVar[int] = 3
2614
+ class VersionSetUrn(_SpecificUrn):
2615
+ ENTITY_TYPE: ClassVar[str] = "versionSet"
2616
+ URN_PARTS: ClassVar[int] = 2
2438
2617
 
2439
- def __init__(self, platform: str, name: str, env: str = "PROD", *, _allow_coercion: bool = True) -> None:
2618
+ def __init__(self, id: str, entity_type: str, *, _allow_coercion: bool = True) -> None:
2440
2619
  if _allow_coercion:
2441
2620
  # Field coercion logic (if any is required).
2442
- platform = DataPlatformUrn(platform).urn()
2443
- name = UrnEncoder.encode_string(name)
2444
- env = env.upper()
2445
- env = UrnEncoder.encode_string(env)
2621
+ id = UrnEncoder.encode_string(id)
2622
+ entity_type = UrnEncoder.encode_string(entity_type)
2446
2623
 
2447
2624
  # Validation logic.
2448
- if not platform:
2449
- raise InvalidUrnError("DatasetUrn platform cannot be empty")
2450
- platform = str(platform)
2451
- assert DataPlatformUrn.from_string(platform)
2452
- if not name:
2453
- raise InvalidUrnError("DatasetUrn name cannot be empty")
2454
- if UrnEncoder.contains_reserved_char(name):
2455
- raise InvalidUrnError(f'DatasetUrn name contains reserved characters')
2456
- if not env:
2457
- raise InvalidUrnError("DatasetUrn env cannot be empty")
2458
- if UrnEncoder.contains_reserved_char(env):
2459
- raise InvalidUrnError(f'DatasetUrn env contains reserved characters')
2625
+ if not id:
2626
+ raise InvalidUrnError("VersionSetUrn id cannot be empty")
2627
+ if UrnEncoder.contains_reserved_char(id):
2628
+ raise InvalidUrnError(f'VersionSetUrn id contains reserved characters')
2629
+ if not entity_type:
2630
+ raise InvalidUrnError("VersionSetUrn entity_type cannot be empty")
2631
+ if UrnEncoder.contains_reserved_char(entity_type):
2632
+ raise InvalidUrnError(f'VersionSetUrn entity_type contains reserved characters')
2460
2633
 
2461
- super().__init__(self.ENTITY_TYPE, [platform, name, env])
2634
+ super().__init__(self.ENTITY_TYPE, [id, entity_type])
2462
2635
 
2463
2636
  @classmethod
2464
- def _parse_ids(cls, entity_ids: List[str]) -> "DatasetUrn":
2637
+ def _parse_ids(cls, entity_ids: List[str]) -> "VersionSetUrn":
2465
2638
  if len(entity_ids) != cls.URN_PARTS:
2466
- raise InvalidUrnError(f"DatasetUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2467
- return cls(platform=entity_ids[0], name=entity_ids[1], env=entity_ids[2], _allow_coercion=False)
2639
+ raise InvalidUrnError(f"VersionSetUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2640
+ return cls(id=entity_ids[0], entity_type=entity_ids[1], _allow_coercion=False)
2468
2641
 
2469
2642
  @classmethod
2470
- def underlying_key_aspect_type(cls) -> Type["DatasetKeyClass"]:
2471
- from datahub.metadata.schema_classes import DatasetKeyClass
2472
-
2473
- return DatasetKeyClass
2643
+ def underlying_key_aspect_type(cls) -> Type["VersionSetKeyClass"]:
2644
+ from datahub.metadata.schema_classes import VersionSetKeyClass
2474
2645
 
2475
- def to_key_aspect(self) -> "DatasetKeyClass":
2476
- from datahub.metadata.schema_classes import DatasetKeyClass
2646
+ return VersionSetKeyClass
2477
2647
 
2478
- return DatasetKeyClass(platform=self.platform, name=self.name, origin=self.env)
2648
+ def to_key_aspect(self) -> "VersionSetKeyClass":
2649
+ from datahub.metadata.schema_classes import VersionSetKeyClass
2479
2650
 
2480
- @classmethod
2481
- def from_key_aspect(cls, key_aspect: "DatasetKeyClass") -> "DatasetUrn":
2482
- return cls(platform=key_aspect.platform, name=key_aspect.name, env=key_aspect.origin)
2651
+ return VersionSetKeyClass(id=self.id, entityType=self.entity_type)
2483
2652
 
2484
2653
  @classmethod
2485
- def create_from_ids(
2486
- cls,
2487
- platform_id: str,
2488
- table_name: str,
2489
- env: str,
2490
- platform_instance: Optional[str] = None,
2491
- ) -> "DatasetUrn":
2492
- return DatasetUrn(
2493
- platform=platform_id,
2494
- name=f"{platform_instance}.{table_name}" if platform_instance else table_name,
2495
- env=env,
2496
- )
2497
-
2498
- from datahub.utilities.urns.field_paths import get_simple_field_path_from_v2_field_path as _get_simple_field_path_from_v2_field_path
2499
-
2500
- get_simple_field_path_from_v2_field_path = staticmethod(deprecated(reason='Use the function from the field_paths module instead')(_get_simple_field_path_from_v2_field_path))
2501
-
2502
- def get_data_platform_urn(self) -> "DataPlatformUrn":
2503
- return DataPlatformUrn.from_string(self.platform)
2504
-
2505
- @deprecated(reason="Use .name instead")
2506
- def get_dataset_name(self) -> str:
2507
- return self.name
2508
-
2509
- @deprecated(reason="Use .env instead")
2510
- def get_env(self) -> str:
2511
- return self.env
2654
+ def from_key_aspect(cls, key_aspect: "VersionSetKeyClass") -> "VersionSetUrn":
2655
+ return cls(id=key_aspect.id, entity_type=key_aspect.entityType)
2512
2656
 
2513
2657
  @property
2514
- def platform(self) -> str:
2658
+ def id(self) -> str:
2515
2659
  return self.entity_ids[0]
2516
2660
 
2517
2661
  @property
2518
- def name(self) -> str:
2662
+ def entity_type(self) -> str:
2519
2663
  return self.entity_ids[1]
2520
2664
 
2521
- @property
2522
- def env(self) -> str:
2523
- return self.entity_ids[2]
2524
-
2525
2665
  if TYPE_CHECKING:
2526
- from datahub.metadata.schema_classes import DashboardKeyClass
2666
+ from datahub.metadata.schema_classes import RecommendationModuleKeyClass
2527
2667
 
2528
- class DashboardUrn(_SpecificUrn):
2529
- ENTITY_TYPE: ClassVar[str] = "dashboard"
2668
+ class RecommendationModuleUrn(_SpecificUrn):
2669
+ ENTITY_TYPE: ClassVar[str] = "recommendationModule"
2530
2670
  URN_PARTS: ClassVar[int] = 2
2531
2671
 
2532
- def __init__(self, dashboard_tool: str, dashboard_id: str, *, _allow_coercion: bool = True) -> None:
2672
+ def __init__(self, module_id: str, identifier: str, *, _allow_coercion: bool = True) -> None:
2533
2673
  if _allow_coercion:
2534
2674
  # Field coercion logic (if any is required).
2535
- dashboard_tool = UrnEncoder.encode_string(dashboard_tool)
2536
- dashboard_id = UrnEncoder.encode_string(dashboard_id)
2675
+ module_id = UrnEncoder.encode_string(module_id)
2676
+ identifier = UrnEncoder.encode_string(identifier)
2537
2677
 
2538
- # Validation logic.
2539
- if not dashboard_tool:
2540
- raise InvalidUrnError("DashboardUrn dashboard_tool cannot be empty")
2541
- if UrnEncoder.contains_reserved_char(dashboard_tool):
2542
- raise InvalidUrnError(f'DashboardUrn dashboard_tool contains reserved characters')
2543
- if not dashboard_id:
2544
- raise InvalidUrnError("DashboardUrn dashboard_id cannot be empty")
2545
- if UrnEncoder.contains_reserved_char(dashboard_id):
2546
- raise InvalidUrnError(f'DashboardUrn dashboard_id contains reserved characters')
2678
+ # Validation logic.
2679
+ if not module_id:
2680
+ raise InvalidUrnError("RecommendationModuleUrn module_id cannot be empty")
2681
+ if UrnEncoder.contains_reserved_char(module_id):
2682
+ raise InvalidUrnError(f'RecommendationModuleUrn module_id contains reserved characters')
2683
+ if not identifier:
2684
+ raise InvalidUrnError("RecommendationModuleUrn identifier cannot be empty")
2685
+ if UrnEncoder.contains_reserved_char(identifier):
2686
+ raise InvalidUrnError(f'RecommendationModuleUrn identifier contains reserved characters')
2547
2687
 
2548
- super().__init__(self.ENTITY_TYPE, [dashboard_tool, dashboard_id])
2688
+ super().__init__(self.ENTITY_TYPE, [module_id, identifier])
2549
2689
 
2550
2690
  @classmethod
2551
- def _parse_ids(cls, entity_ids: List[str]) -> "DashboardUrn":
2691
+ def _parse_ids(cls, entity_ids: List[str]) -> "RecommendationModuleUrn":
2552
2692
  if len(entity_ids) != cls.URN_PARTS:
2553
- raise InvalidUrnError(f"DashboardUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2554
- return cls(dashboard_tool=entity_ids[0], dashboard_id=entity_ids[1], _allow_coercion=False)
2693
+ raise InvalidUrnError(f"RecommendationModuleUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2694
+ return cls(module_id=entity_ids[0], identifier=entity_ids[1], _allow_coercion=False)
2555
2695
 
2556
2696
  @classmethod
2557
- def underlying_key_aspect_type(cls) -> Type["DashboardKeyClass"]:
2558
- from datahub.metadata.schema_classes import DashboardKeyClass
2697
+ def underlying_key_aspect_type(cls) -> Type["RecommendationModuleKeyClass"]:
2698
+ from datahub.metadata.schema_classes import RecommendationModuleKeyClass
2559
2699
 
2560
- return DashboardKeyClass
2700
+ return RecommendationModuleKeyClass
2561
2701
 
2562
- def to_key_aspect(self) -> "DashboardKeyClass":
2563
- from datahub.metadata.schema_classes import DashboardKeyClass
2702
+ def to_key_aspect(self) -> "RecommendationModuleKeyClass":
2703
+ from datahub.metadata.schema_classes import RecommendationModuleKeyClass
2564
2704
 
2565
- return DashboardKeyClass(dashboardTool=self.dashboard_tool, dashboardId=self.dashboard_id)
2705
+ return RecommendationModuleKeyClass(moduleId=self.module_id, identifier=self.identifier)
2566
2706
 
2567
2707
  @classmethod
2568
- def from_key_aspect(cls, key_aspect: "DashboardKeyClass") -> "DashboardUrn":
2569
- return cls(dashboard_tool=key_aspect.dashboardTool, dashboard_id=key_aspect.dashboardId)
2708
+ def from_key_aspect(cls, key_aspect: "RecommendationModuleKeyClass") -> "RecommendationModuleUrn":
2709
+ return cls(module_id=key_aspect.moduleId, identifier=key_aspect.identifier)
2570
2710
 
2571
2711
  @property
2572
- def dashboard_tool(self) -> str:
2712
+ def module_id(self) -> str:
2573
2713
  return self.entity_ids[0]
2574
2714
 
2575
2715
  @property
2576
- def dashboard_id(self) -> str:
2716
+ def identifier(self) -> str:
2577
2717
  return self.entity_ids[1]
2578
2718
 
2579
2719
  if TYPE_CHECKING:
2580
- from datahub.metadata.schema_classes import DataHubViewKeyClass
2720
+ from datahub.metadata.schema_classes import LinkPreviewKeyClass
2581
2721
 
2582
- class DataHubViewUrn(_SpecificUrn):
2583
- ENTITY_TYPE: ClassVar[str] = "dataHubView"
2722
+ class LinkPreviewUrn(_SpecificUrn):
2723
+ ENTITY_TYPE: ClassVar[str] = "linkPreview"
2584
2724
  URN_PARTS: ClassVar[int] = 1
2585
2725
 
2586
2726
  def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
@@ -2590,31 +2730,31 @@ class DataHubViewUrn(_SpecificUrn):
2590
2730
 
2591
2731
  # Validation logic.
2592
2732
  if not id:
2593
- raise InvalidUrnError("DataHubViewUrn id cannot be empty")
2733
+ raise InvalidUrnError("LinkPreviewUrn id cannot be empty")
2594
2734
  if UrnEncoder.contains_reserved_char(id):
2595
- raise InvalidUrnError(f'DataHubViewUrn id contains reserved characters')
2735
+ raise InvalidUrnError(f'LinkPreviewUrn id contains reserved characters')
2596
2736
 
2597
2737
  super().__init__(self.ENTITY_TYPE, [id])
2598
2738
 
2599
2739
  @classmethod
2600
- def _parse_ids(cls, entity_ids: List[str]) -> "DataHubViewUrn":
2740
+ def _parse_ids(cls, entity_ids: List[str]) -> "LinkPreviewUrn":
2601
2741
  if len(entity_ids) != cls.URN_PARTS:
2602
- raise InvalidUrnError(f"DataHubViewUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2742
+ raise InvalidUrnError(f"LinkPreviewUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2603
2743
  return cls(id=entity_ids[0], _allow_coercion=False)
2604
2744
 
2605
2745
  @classmethod
2606
- def underlying_key_aspect_type(cls) -> Type["DataHubViewKeyClass"]:
2607
- from datahub.metadata.schema_classes import DataHubViewKeyClass
2746
+ def underlying_key_aspect_type(cls) -> Type["LinkPreviewKeyClass"]:
2747
+ from datahub.metadata.schema_classes import LinkPreviewKeyClass
2608
2748
 
2609
- return DataHubViewKeyClass
2749
+ return LinkPreviewKeyClass
2610
2750
 
2611
- def to_key_aspect(self) -> "DataHubViewKeyClass":
2612
- from datahub.metadata.schema_classes import DataHubViewKeyClass
2751
+ def to_key_aspect(self) -> "LinkPreviewKeyClass":
2752
+ from datahub.metadata.schema_classes import LinkPreviewKeyClass
2613
2753
 
2614
- return DataHubViewKeyClass(id=self.id)
2754
+ return LinkPreviewKeyClass(id=self.id)
2615
2755
 
2616
2756
  @classmethod
2617
- def from_key_aspect(cls, key_aspect: "DataHubViewKeyClass") -> "DataHubViewUrn":
2757
+ def from_key_aspect(cls, key_aspect: "LinkPreviewKeyClass") -> "LinkPreviewUrn":
2618
2758
  return cls(id=key_aspect.id)
2619
2759
 
2620
2760
  @property
@@ -2674,96 +2814,6 @@ class MonitorUrn(_SpecificUrn):
2674
2814
  def id(self) -> str:
2675
2815
  return self.entity_ids[1]
2676
2816
 
2677
- if TYPE_CHECKING:
2678
- from datahub.metadata.schema_classes import InviteTokenKeyClass
2679
-
2680
- class InviteTokenUrn(_SpecificUrn):
2681
- ENTITY_TYPE: ClassVar[str] = "inviteToken"
2682
- URN_PARTS: ClassVar[int] = 1
2683
-
2684
- def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
2685
- if _allow_coercion:
2686
- # Field coercion logic (if any is required).
2687
- id = UrnEncoder.encode_string(id)
2688
-
2689
- # Validation logic.
2690
- if not id:
2691
- raise InvalidUrnError("InviteTokenUrn id cannot be empty")
2692
- if UrnEncoder.contains_reserved_char(id):
2693
- raise InvalidUrnError(f'InviteTokenUrn id contains reserved characters')
2694
-
2695
- super().__init__(self.ENTITY_TYPE, [id])
2696
-
2697
- @classmethod
2698
- def _parse_ids(cls, entity_ids: List[str]) -> "InviteTokenUrn":
2699
- if len(entity_ids) != cls.URN_PARTS:
2700
- raise InvalidUrnError(f"InviteTokenUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2701
- return cls(id=entity_ids[0], _allow_coercion=False)
2702
-
2703
- @classmethod
2704
- def underlying_key_aspect_type(cls) -> Type["InviteTokenKeyClass"]:
2705
- from datahub.metadata.schema_classes import InviteTokenKeyClass
2706
-
2707
- return InviteTokenKeyClass
2708
-
2709
- def to_key_aspect(self) -> "InviteTokenKeyClass":
2710
- from datahub.metadata.schema_classes import InviteTokenKeyClass
2711
-
2712
- return InviteTokenKeyClass(id=self.id)
2713
-
2714
- @classmethod
2715
- def from_key_aspect(cls, key_aspect: "InviteTokenKeyClass") -> "InviteTokenUrn":
2716
- return cls(id=key_aspect.id)
2717
-
2718
- @property
2719
- def id(self) -> str:
2720
- return self.entity_ids[0]
2721
-
2722
- if TYPE_CHECKING:
2723
- from datahub.metadata.schema_classes import DataHubPolicyKeyClass
2724
-
2725
- class DataHubPolicyUrn(_SpecificUrn):
2726
- ENTITY_TYPE: ClassVar[str] = "dataHubPolicy"
2727
- URN_PARTS: ClassVar[int] = 1
2728
-
2729
- def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
2730
- if _allow_coercion:
2731
- # Field coercion logic (if any is required).
2732
- id = UrnEncoder.encode_string(id)
2733
-
2734
- # Validation logic.
2735
- if not id:
2736
- raise InvalidUrnError("DataHubPolicyUrn id cannot be empty")
2737
- if UrnEncoder.contains_reserved_char(id):
2738
- raise InvalidUrnError(f'DataHubPolicyUrn id contains reserved characters')
2739
-
2740
- super().__init__(self.ENTITY_TYPE, [id])
2741
-
2742
- @classmethod
2743
- def _parse_ids(cls, entity_ids: List[str]) -> "DataHubPolicyUrn":
2744
- if len(entity_ids) != cls.URN_PARTS:
2745
- raise InvalidUrnError(f"DataHubPolicyUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2746
- return cls(id=entity_ids[0], _allow_coercion=False)
2747
-
2748
- @classmethod
2749
- def underlying_key_aspect_type(cls) -> Type["DataHubPolicyKeyClass"]:
2750
- from datahub.metadata.schema_classes import DataHubPolicyKeyClass
2751
-
2752
- return DataHubPolicyKeyClass
2753
-
2754
- def to_key_aspect(self) -> "DataHubPolicyKeyClass":
2755
- from datahub.metadata.schema_classes import DataHubPolicyKeyClass
2756
-
2757
- return DataHubPolicyKeyClass(id=self.id)
2758
-
2759
- @classmethod
2760
- def from_key_aspect(cls, key_aspect: "DataHubPolicyKeyClass") -> "DataHubPolicyUrn":
2761
- return cls(id=key_aspect.id)
2762
-
2763
- @property
2764
- def id(self) -> str:
2765
- return self.entity_ids[0]
2766
-
2767
2817
  if TYPE_CHECKING:
2768
2818
  from datahub.metadata.schema_classes import DomainKeyClass
2769
2819
 
@@ -2815,10 +2865,10 @@ class DomainUrn(_SpecificUrn):
2815
2865
  return self.entity_ids[0]
2816
2866
 
2817
2867
  if TYPE_CHECKING:
2818
- from datahub.metadata.schema_classes import DataHubActionKeyClass
2868
+ from datahub.metadata.schema_classes import DataHubStepStateKeyClass
2819
2869
 
2820
- class DataHubActionUrn(_SpecificUrn):
2821
- ENTITY_TYPE: ClassVar[str] = "dataHubAction"
2870
+ class DataHubStepStateUrn(_SpecificUrn):
2871
+ ENTITY_TYPE: ClassVar[str] = "dataHubStepState"
2822
2872
  URN_PARTS: ClassVar[int] = 1
2823
2873
 
2824
2874
  def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
@@ -2828,31 +2878,31 @@ class DataHubActionUrn(_SpecificUrn):
2828
2878
 
2829
2879
  # Validation logic.
2830
2880
  if not id:
2831
- raise InvalidUrnError("DataHubActionUrn id cannot be empty")
2881
+ raise InvalidUrnError("DataHubStepStateUrn id cannot be empty")
2832
2882
  if UrnEncoder.contains_reserved_char(id):
2833
- raise InvalidUrnError(f'DataHubActionUrn id contains reserved characters')
2883
+ raise InvalidUrnError(f'DataHubStepStateUrn id contains reserved characters')
2834
2884
 
2835
2885
  super().__init__(self.ENTITY_TYPE, [id])
2836
2886
 
2837
2887
  @classmethod
2838
- def _parse_ids(cls, entity_ids: List[str]) -> "DataHubActionUrn":
2888
+ def _parse_ids(cls, entity_ids: List[str]) -> "DataHubStepStateUrn":
2839
2889
  if len(entity_ids) != cls.URN_PARTS:
2840
- raise InvalidUrnError(f"DataHubActionUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2890
+ raise InvalidUrnError(f"DataHubStepStateUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2841
2891
  return cls(id=entity_ids[0], _allow_coercion=False)
2842
2892
 
2843
2893
  @classmethod
2844
- def underlying_key_aspect_type(cls) -> Type["DataHubActionKeyClass"]:
2845
- from datahub.metadata.schema_classes import DataHubActionKeyClass
2894
+ def underlying_key_aspect_type(cls) -> Type["DataHubStepStateKeyClass"]:
2895
+ from datahub.metadata.schema_classes import DataHubStepStateKeyClass
2846
2896
 
2847
- return DataHubActionKeyClass
2897
+ return DataHubStepStateKeyClass
2848
2898
 
2849
- def to_key_aspect(self) -> "DataHubActionKeyClass":
2850
- from datahub.metadata.schema_classes import DataHubActionKeyClass
2899
+ def to_key_aspect(self) -> "DataHubStepStateKeyClass":
2900
+ from datahub.metadata.schema_classes import DataHubStepStateKeyClass
2851
2901
 
2852
- return DataHubActionKeyClass(id=self.id)
2902
+ return DataHubStepStateKeyClass(id=self.id)
2853
2903
 
2854
2904
  @classmethod
2855
- def from_key_aspect(cls, key_aspect: "DataHubActionKeyClass") -> "DataHubActionUrn":
2905
+ def from_key_aspect(cls, key_aspect: "DataHubStepStateKeyClass") -> "DataHubStepStateUrn":
2856
2906
  return cls(id=key_aspect.id)
2857
2907
 
2858
2908
  @property
@@ -2860,164 +2910,154 @@ class DataHubActionUrn(_SpecificUrn):
2860
2910
  return self.entity_ids[0]
2861
2911
 
2862
2912
  if TYPE_CHECKING:
2863
- from datahub.metadata.schema_classes import TelemetryKeyClass
2913
+ from datahub.metadata.schema_classes import DataHubAccessTokenKeyClass
2864
2914
 
2865
- class TelemetryUrn(_SpecificUrn):
2866
- ENTITY_TYPE: ClassVar[str] = "telemetry"
2915
+ class DataHubAccessTokenUrn(_SpecificUrn):
2916
+ ENTITY_TYPE: ClassVar[str] = "dataHubAccessToken"
2867
2917
  URN_PARTS: ClassVar[int] = 1
2868
2918
 
2869
- def __init__(self, name: str, *, _allow_coercion: bool = True) -> None:
2919
+ def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
2870
2920
  if _allow_coercion:
2871
2921
  # Field coercion logic (if any is required).
2872
- name = UrnEncoder.encode_string(name)
2922
+ id = UrnEncoder.encode_string(id)
2873
2923
 
2874
2924
  # Validation logic.
2875
- if not name:
2876
- raise InvalidUrnError("TelemetryUrn name cannot be empty")
2877
- if UrnEncoder.contains_reserved_char(name):
2878
- raise InvalidUrnError(f'TelemetryUrn name contains reserved characters')
2925
+ if not id:
2926
+ raise InvalidUrnError("DataHubAccessTokenUrn id cannot be empty")
2927
+ if UrnEncoder.contains_reserved_char(id):
2928
+ raise InvalidUrnError(f'DataHubAccessTokenUrn id contains reserved characters')
2879
2929
 
2880
- super().__init__(self.ENTITY_TYPE, [name])
2930
+ super().__init__(self.ENTITY_TYPE, [id])
2881
2931
 
2882
2932
  @classmethod
2883
- def _parse_ids(cls, entity_ids: List[str]) -> "TelemetryUrn":
2933
+ def _parse_ids(cls, entity_ids: List[str]) -> "DataHubAccessTokenUrn":
2884
2934
  if len(entity_ids) != cls.URN_PARTS:
2885
- raise InvalidUrnError(f"TelemetryUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2886
- return cls(name=entity_ids[0], _allow_coercion=False)
2935
+ raise InvalidUrnError(f"DataHubAccessTokenUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2936
+ return cls(id=entity_ids[0], _allow_coercion=False)
2887
2937
 
2888
2938
  @classmethod
2889
- def underlying_key_aspect_type(cls) -> Type["TelemetryKeyClass"]:
2890
- from datahub.metadata.schema_classes import TelemetryKeyClass
2939
+ def underlying_key_aspect_type(cls) -> Type["DataHubAccessTokenKeyClass"]:
2940
+ from datahub.metadata.schema_classes import DataHubAccessTokenKeyClass
2891
2941
 
2892
- return TelemetryKeyClass
2942
+ return DataHubAccessTokenKeyClass
2893
2943
 
2894
- def to_key_aspect(self) -> "TelemetryKeyClass":
2895
- from datahub.metadata.schema_classes import TelemetryKeyClass
2944
+ def to_key_aspect(self) -> "DataHubAccessTokenKeyClass":
2945
+ from datahub.metadata.schema_classes import DataHubAccessTokenKeyClass
2896
2946
 
2897
- return TelemetryKeyClass(name=self.name)
2947
+ return DataHubAccessTokenKeyClass(id=self.id)
2898
2948
 
2899
2949
  @classmethod
2900
- def from_key_aspect(cls, key_aspect: "TelemetryKeyClass") -> "TelemetryUrn":
2901
- return cls(name=key_aspect.name)
2950
+ def from_key_aspect(cls, key_aspect: "DataHubAccessTokenKeyClass") -> "DataHubAccessTokenUrn":
2951
+ return cls(id=key_aspect.id)
2902
2952
 
2903
2953
  @property
2904
- def name(self) -> str:
2954
+ def id(self) -> str:
2905
2955
  return self.entity_ids[0]
2906
2956
 
2907
2957
  if TYPE_CHECKING:
2908
- from datahub.metadata.schema_classes import MLModelKeyClass
2958
+ from datahub.metadata.schema_classes import DataHubSecretKeyClass
2909
2959
 
2910
- class MlModelUrn(_SpecificUrn):
2911
- ENTITY_TYPE: ClassVar[str] = "mlModel"
2912
- URN_PARTS: ClassVar[int] = 3
2960
+ class DataHubSecretUrn(_SpecificUrn):
2961
+ ENTITY_TYPE: ClassVar[str] = "dataHubSecret"
2962
+ URN_PARTS: ClassVar[int] = 1
2913
2963
 
2914
- def __init__(self, platform: str, name: str, env: str = "PROD", *, _allow_coercion: bool = True) -> None:
2964
+ def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
2915
2965
  if _allow_coercion:
2916
2966
  # Field coercion logic (if any is required).
2917
- platform = DataPlatformUrn(platform).urn()
2918
- name = UrnEncoder.encode_string(name)
2919
- env = env.upper()
2920
- env = UrnEncoder.encode_string(env)
2921
-
2922
- # Validation logic.
2923
- if not platform:
2924
- raise InvalidUrnError("MlModelUrn platform cannot be empty")
2925
- platform = str(platform)
2926
- assert DataPlatformUrn.from_string(platform)
2927
- if not name:
2928
- raise InvalidUrnError("MlModelUrn name cannot be empty")
2929
- if UrnEncoder.contains_reserved_char(name):
2930
- raise InvalidUrnError(f'MlModelUrn name contains reserved characters')
2931
- if not env:
2932
- raise InvalidUrnError("MlModelUrn env cannot be empty")
2933
- if UrnEncoder.contains_reserved_char(env):
2934
- raise InvalidUrnError(f'MlModelUrn env contains reserved characters')
2967
+ id = UrnEncoder.encode_string(id)
2935
2968
 
2936
- super().__init__(self.ENTITY_TYPE, [platform, name, env])
2969
+ # Validation logic.
2970
+ if not id:
2971
+ raise InvalidUrnError("DataHubSecretUrn id cannot be empty")
2972
+ if UrnEncoder.contains_reserved_char(id):
2973
+ raise InvalidUrnError(f'DataHubSecretUrn id contains reserved characters')
2974
+
2975
+ super().__init__(self.ENTITY_TYPE, [id])
2937
2976
 
2938
2977
  @classmethod
2939
- def _parse_ids(cls, entity_ids: List[str]) -> "MlModelUrn":
2978
+ def _parse_ids(cls, entity_ids: List[str]) -> "DataHubSecretUrn":
2940
2979
  if len(entity_ids) != cls.URN_PARTS:
2941
- raise InvalidUrnError(f"MlModelUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2942
- return cls(platform=entity_ids[0], name=entity_ids[1], env=entity_ids[2], _allow_coercion=False)
2980
+ raise InvalidUrnError(f"DataHubSecretUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2981
+ return cls(id=entity_ids[0], _allow_coercion=False)
2943
2982
 
2944
2983
  @classmethod
2945
- def underlying_key_aspect_type(cls) -> Type["MLModelKeyClass"]:
2946
- from datahub.metadata.schema_classes import MLModelKeyClass
2984
+ def underlying_key_aspect_type(cls) -> Type["DataHubSecretKeyClass"]:
2985
+ from datahub.metadata.schema_classes import DataHubSecretKeyClass
2947
2986
 
2948
- return MLModelKeyClass
2987
+ return DataHubSecretKeyClass
2949
2988
 
2950
- def to_key_aspect(self) -> "MLModelKeyClass":
2951
- from datahub.metadata.schema_classes import MLModelKeyClass
2989
+ def to_key_aspect(self) -> "DataHubSecretKeyClass":
2990
+ from datahub.metadata.schema_classes import DataHubSecretKeyClass
2952
2991
 
2953
- return MLModelKeyClass(platform=self.platform, name=self.name, origin=self.env)
2992
+ return DataHubSecretKeyClass(id=self.id)
2954
2993
 
2955
2994
  @classmethod
2956
- def from_key_aspect(cls, key_aspect: "MLModelKeyClass") -> "MlModelUrn":
2957
- return cls(platform=key_aspect.platform, name=key_aspect.name, env=key_aspect.origin)
2995
+ def from_key_aspect(cls, key_aspect: "DataHubSecretKeyClass") -> "DataHubSecretUrn":
2996
+ return cls(id=key_aspect.id)
2958
2997
 
2959
2998
  @property
2960
- def platform(self) -> str:
2999
+ def id(self) -> str:
2961
3000
  return self.entity_ids[0]
2962
3001
 
2963
- @property
2964
- def name(self) -> str:
2965
- return self.entity_ids[1]
2966
-
2967
- @property
2968
- def env(self) -> str:
2969
- return self.entity_ids[2]
2970
-
2971
3002
  if TYPE_CHECKING:
2972
- from datahub.metadata.schema_classes import StructuredPropertyKeyClass
3003
+ from datahub.metadata.schema_classes import DataPlatformInstanceKeyClass
2973
3004
 
2974
- class StructuredPropertyUrn(_SpecificUrn):
2975
- ENTITY_TYPE: ClassVar[str] = "structuredProperty"
2976
- URN_PARTS: ClassVar[int] = 1
3005
+ class DataPlatformInstanceUrn(_SpecificUrn):
3006
+ ENTITY_TYPE: ClassVar[str] = "dataPlatformInstance"
3007
+ URN_PARTS: ClassVar[int] = 2
2977
3008
 
2978
- def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
3009
+ def __init__(self, platform: str, instance: str, *, _allow_coercion: bool = True) -> None:
2979
3010
  if _allow_coercion:
2980
3011
  # Field coercion logic (if any is required).
2981
- id = UrnEncoder.encode_string(id)
3012
+ platform = DataPlatformUrn(platform).urn()
3013
+ instance = UrnEncoder.encode_string(instance)
2982
3014
 
2983
3015
  # Validation logic.
2984
- if not id:
2985
- raise InvalidUrnError("StructuredPropertyUrn id cannot be empty")
2986
- if UrnEncoder.contains_reserved_char(id):
2987
- raise InvalidUrnError(f'StructuredPropertyUrn id contains reserved characters')
3016
+ if not platform:
3017
+ raise InvalidUrnError("DataPlatformInstanceUrn platform cannot be empty")
3018
+ platform = str(platform)
3019
+ assert DataPlatformUrn.from_string(platform)
3020
+ if not instance:
3021
+ raise InvalidUrnError("DataPlatformInstanceUrn instance cannot be empty")
3022
+ if UrnEncoder.contains_reserved_char(instance):
3023
+ raise InvalidUrnError(f'DataPlatformInstanceUrn instance contains reserved characters')
2988
3024
 
2989
- super().__init__(self.ENTITY_TYPE, [id])
3025
+ super().__init__(self.ENTITY_TYPE, [platform, instance])
2990
3026
 
2991
3027
  @classmethod
2992
- def _parse_ids(cls, entity_ids: List[str]) -> "StructuredPropertyUrn":
3028
+ def _parse_ids(cls, entity_ids: List[str]) -> "DataPlatformInstanceUrn":
2993
3029
  if len(entity_ids) != cls.URN_PARTS:
2994
- raise InvalidUrnError(f"StructuredPropertyUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
2995
- return cls(id=entity_ids[0], _allow_coercion=False)
3030
+ raise InvalidUrnError(f"DataPlatformInstanceUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
3031
+ return cls(platform=entity_ids[0], instance=entity_ids[1], _allow_coercion=False)
2996
3032
 
2997
3033
  @classmethod
2998
- def underlying_key_aspect_type(cls) -> Type["StructuredPropertyKeyClass"]:
2999
- from datahub.metadata.schema_classes import StructuredPropertyKeyClass
3034
+ def underlying_key_aspect_type(cls) -> Type["DataPlatformInstanceKeyClass"]:
3035
+ from datahub.metadata.schema_classes import DataPlatformInstanceKeyClass
3000
3036
 
3001
- return StructuredPropertyKeyClass
3037
+ return DataPlatformInstanceKeyClass
3002
3038
 
3003
- def to_key_aspect(self) -> "StructuredPropertyKeyClass":
3004
- from datahub.metadata.schema_classes import StructuredPropertyKeyClass
3039
+ def to_key_aspect(self) -> "DataPlatformInstanceKeyClass":
3040
+ from datahub.metadata.schema_classes import DataPlatformInstanceKeyClass
3005
3041
 
3006
- return StructuredPropertyKeyClass(id=self.id)
3042
+ return DataPlatformInstanceKeyClass(platform=self.platform, instance=self.instance)
3007
3043
 
3008
3044
  @classmethod
3009
- def from_key_aspect(cls, key_aspect: "StructuredPropertyKeyClass") -> "StructuredPropertyUrn":
3010
- return cls(id=key_aspect.id)
3045
+ def from_key_aspect(cls, key_aspect: "DataPlatformInstanceKeyClass") -> "DataPlatformInstanceUrn":
3046
+ return cls(platform=key_aspect.platform, instance=key_aspect.instance)
3011
3047
 
3012
3048
  @property
3013
- def id(self) -> str:
3049
+ def platform(self) -> str:
3014
3050
  return self.entity_ids[0]
3015
3051
 
3052
+ @property
3053
+ def instance(self) -> str:
3054
+ return self.entity_ids[1]
3055
+
3016
3056
  if TYPE_CHECKING:
3017
- from datahub.metadata.schema_classes import DataTypeKeyClass
3057
+ from datahub.metadata.schema_classes import InviteTokenKeyClass
3018
3058
 
3019
- class DataTypeUrn(_SpecificUrn):
3020
- ENTITY_TYPE: ClassVar[str] = "dataType"
3059
+ class InviteTokenUrn(_SpecificUrn):
3060
+ ENTITY_TYPE: ClassVar[str] = "inviteToken"
3021
3061
  URN_PARTS: ClassVar[int] = 1
3022
3062
 
3023
3063
  def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
@@ -3027,31 +3067,31 @@ class DataTypeUrn(_SpecificUrn):
3027
3067
 
3028
3068
  # Validation logic.
3029
3069
  if not id:
3030
- raise InvalidUrnError("DataTypeUrn id cannot be empty")
3070
+ raise InvalidUrnError("InviteTokenUrn id cannot be empty")
3031
3071
  if UrnEncoder.contains_reserved_char(id):
3032
- raise InvalidUrnError(f'DataTypeUrn id contains reserved characters')
3072
+ raise InvalidUrnError(f'InviteTokenUrn id contains reserved characters')
3033
3073
 
3034
3074
  super().__init__(self.ENTITY_TYPE, [id])
3035
3075
 
3036
3076
  @classmethod
3037
- def _parse_ids(cls, entity_ids: List[str]) -> "DataTypeUrn":
3077
+ def _parse_ids(cls, entity_ids: List[str]) -> "InviteTokenUrn":
3038
3078
  if len(entity_ids) != cls.URN_PARTS:
3039
- raise InvalidUrnError(f"DataTypeUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
3079
+ raise InvalidUrnError(f"InviteTokenUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
3040
3080
  return cls(id=entity_ids[0], _allow_coercion=False)
3041
3081
 
3042
3082
  @classmethod
3043
- def underlying_key_aspect_type(cls) -> Type["DataTypeKeyClass"]:
3044
- from datahub.metadata.schema_classes import DataTypeKeyClass
3083
+ def underlying_key_aspect_type(cls) -> Type["InviteTokenKeyClass"]:
3084
+ from datahub.metadata.schema_classes import InviteTokenKeyClass
3045
3085
 
3046
- return DataTypeKeyClass
3086
+ return InviteTokenKeyClass
3047
3087
 
3048
- def to_key_aspect(self) -> "DataTypeKeyClass":
3049
- from datahub.metadata.schema_classes import DataTypeKeyClass
3088
+ def to_key_aspect(self) -> "InviteTokenKeyClass":
3089
+ from datahub.metadata.schema_classes import InviteTokenKeyClass
3050
3090
 
3051
- return DataTypeKeyClass(id=self.id)
3091
+ return InviteTokenKeyClass(id=self.id)
3052
3092
 
3053
3093
  @classmethod
3054
- def from_key_aspect(cls, key_aspect: "DataTypeKeyClass") -> "DataTypeUrn":
3094
+ def from_key_aspect(cls, key_aspect: "InviteTokenKeyClass") -> "InviteTokenUrn":
3055
3095
  return cls(id=key_aspect.id)
3056
3096
 
3057
3097
  @property
@@ -3059,55 +3099,60 @@ class DataTypeUrn(_SpecificUrn):
3059
3099
  return self.entity_ids[0]
3060
3100
 
3061
3101
  if TYPE_CHECKING:
3062
- from datahub.metadata.schema_classes import BusinessAttributeKeyClass
3102
+ from datahub.metadata.schema_classes import CorpUserKeyClass
3063
3103
 
3064
- class BusinessAttributeUrn(_SpecificUrn):
3065
- ENTITY_TYPE: ClassVar[str] = "businessAttribute"
3104
+ class CorpUserUrn(_SpecificUrn):
3105
+ ENTITY_TYPE: ClassVar[str] = "corpuser"
3066
3106
  URN_PARTS: ClassVar[int] = 1
3067
3107
 
3068
- def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
3108
+ def __init__(self, username: str, *, _allow_coercion: bool = True) -> None:
3069
3109
  if _allow_coercion:
3070
3110
  # Field coercion logic (if any is required).
3071
- id = UrnEncoder.encode_string(id)
3111
+ username = UrnEncoder.encode_string(username)
3072
3112
 
3073
3113
  # Validation logic.
3074
- if not id:
3075
- raise InvalidUrnError("BusinessAttributeUrn id cannot be empty")
3076
- if UrnEncoder.contains_reserved_char(id):
3077
- raise InvalidUrnError(f'BusinessAttributeUrn id contains reserved characters')
3114
+ if not username:
3115
+ raise InvalidUrnError("CorpUserUrn username cannot be empty")
3116
+ if UrnEncoder.contains_reserved_char(username):
3117
+ raise InvalidUrnError(f'CorpUserUrn username contains reserved characters')
3078
3118
 
3079
- super().__init__(self.ENTITY_TYPE, [id])
3119
+ super().__init__(self.ENTITY_TYPE, [username])
3080
3120
 
3081
3121
  @classmethod
3082
- def _parse_ids(cls, entity_ids: List[str]) -> "BusinessAttributeUrn":
3122
+ def _parse_ids(cls, entity_ids: List[str]) -> "CorpUserUrn":
3083
3123
  if len(entity_ids) != cls.URN_PARTS:
3084
- raise InvalidUrnError(f"BusinessAttributeUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
3085
- return cls(id=entity_ids[0], _allow_coercion=False)
3124
+ raise InvalidUrnError(f"CorpUserUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
3125
+ return cls(username=entity_ids[0], _allow_coercion=False)
3086
3126
 
3087
3127
  @classmethod
3088
- def underlying_key_aspect_type(cls) -> Type["BusinessAttributeKeyClass"]:
3089
- from datahub.metadata.schema_classes import BusinessAttributeKeyClass
3128
+ def underlying_key_aspect_type(cls) -> Type["CorpUserKeyClass"]:
3129
+ from datahub.metadata.schema_classes import CorpUserKeyClass
3090
3130
 
3091
- return BusinessAttributeKeyClass
3131
+ return CorpUserKeyClass
3092
3132
 
3093
- def to_key_aspect(self) -> "BusinessAttributeKeyClass":
3094
- from datahub.metadata.schema_classes import BusinessAttributeKeyClass
3133
+ def to_key_aspect(self) -> "CorpUserKeyClass":
3134
+ from datahub.metadata.schema_classes import CorpUserKeyClass
3095
3135
 
3096
- return BusinessAttributeKeyClass(id=self.id)
3136
+ return CorpUserKeyClass(username=self.username)
3097
3137
 
3098
3138
  @classmethod
3099
- def from_key_aspect(cls, key_aspect: "BusinessAttributeKeyClass") -> "BusinessAttributeUrn":
3100
- return cls(id=key_aspect.id)
3139
+ def from_key_aspect(cls, key_aspect: "CorpUserKeyClass") -> "CorpUserUrn":
3140
+ return cls(username=key_aspect.username)
3141
+
3142
+ @classmethod
3143
+ @deprecated(reason="Use the constructor instead")
3144
+ def create_from_id(cls, id: str) -> "CorpUserUrn":
3145
+ return cls(id)
3101
3146
 
3102
3147
  @property
3103
- def id(self) -> str:
3148
+ def username(self) -> str:
3104
3149
  return self.entity_ids[0]
3105
3150
 
3106
3151
  if TYPE_CHECKING:
3107
- from datahub.metadata.schema_classes import DataProductKeyClass
3152
+ from datahub.metadata.schema_classes import RoleKeyClass
3108
3153
 
3109
- class DataProductUrn(_SpecificUrn):
3110
- ENTITY_TYPE: ClassVar[str] = "dataProduct"
3154
+ class RoleUrn(_SpecificUrn):
3155
+ ENTITY_TYPE: ClassVar[str] = "role"
3111
3156
  URN_PARTS: ClassVar[int] = 1
3112
3157
 
3113
3158
  def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
@@ -3117,31 +3162,31 @@ class DataProductUrn(_SpecificUrn):
3117
3162
 
3118
3163
  # Validation logic.
3119
3164
  if not id:
3120
- raise InvalidUrnError("DataProductUrn id cannot be empty")
3165
+ raise InvalidUrnError("RoleUrn id cannot be empty")
3121
3166
  if UrnEncoder.contains_reserved_char(id):
3122
- raise InvalidUrnError(f'DataProductUrn id contains reserved characters')
3167
+ raise InvalidUrnError(f'RoleUrn id contains reserved characters')
3123
3168
 
3124
3169
  super().__init__(self.ENTITY_TYPE, [id])
3125
3170
 
3126
3171
  @classmethod
3127
- def _parse_ids(cls, entity_ids: List[str]) -> "DataProductUrn":
3172
+ def _parse_ids(cls, entity_ids: List[str]) -> "RoleUrn":
3128
3173
  if len(entity_ids) != cls.URN_PARTS:
3129
- raise InvalidUrnError(f"DataProductUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
3174
+ raise InvalidUrnError(f"RoleUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
3130
3175
  return cls(id=entity_ids[0], _allow_coercion=False)
3131
3176
 
3132
3177
  @classmethod
3133
- def underlying_key_aspect_type(cls) -> Type["DataProductKeyClass"]:
3134
- from datahub.metadata.schema_classes import DataProductKeyClass
3178
+ def underlying_key_aspect_type(cls) -> Type["RoleKeyClass"]:
3179
+ from datahub.metadata.schema_classes import RoleKeyClass
3135
3180
 
3136
- return DataProductKeyClass
3181
+ return RoleKeyClass
3137
3182
 
3138
- def to_key_aspect(self) -> "DataProductKeyClass":
3139
- from datahub.metadata.schema_classes import DataProductKeyClass
3183
+ def to_key_aspect(self) -> "RoleKeyClass":
3184
+ from datahub.metadata.schema_classes import RoleKeyClass
3140
3185
 
3141
- return DataProductKeyClass(id=self.id)
3186
+ return RoleKeyClass(id=self.id)
3142
3187
 
3143
3188
  @classmethod
3144
- def from_key_aspect(cls, key_aspect: "DataProductKeyClass") -> "DataProductUrn":
3189
+ def from_key_aspect(cls, key_aspect: "RoleKeyClass") -> "RoleUrn":
3145
3190
  return cls(id=key_aspect.id)
3146
3191
 
3147
3192
  @property
@@ -3149,10 +3194,10 @@ class DataProductUrn(_SpecificUrn):
3149
3194
  return self.entity_ids[0]
3150
3195
 
3151
3196
  if TYPE_CHECKING:
3152
- from datahub.metadata.schema_classes import EntityTypeKeyClass
3197
+ from datahub.metadata.schema_classes import PostKeyClass
3153
3198
 
3154
- class EntityTypeUrn(_SpecificUrn):
3155
- ENTITY_TYPE: ClassVar[str] = "entityType"
3199
+ class PostUrn(_SpecificUrn):
3200
+ ENTITY_TYPE: ClassVar[str] = "post"
3156
3201
  URN_PARTS: ClassVar[int] = 1
3157
3202
 
3158
3203
  def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
@@ -3162,31 +3207,31 @@ class EntityTypeUrn(_SpecificUrn):
3162
3207
 
3163
3208
  # Validation logic.
3164
3209
  if not id:
3165
- raise InvalidUrnError("EntityTypeUrn id cannot be empty")
3210
+ raise InvalidUrnError("PostUrn id cannot be empty")
3166
3211
  if UrnEncoder.contains_reserved_char(id):
3167
- raise InvalidUrnError(f'EntityTypeUrn id contains reserved characters')
3212
+ raise InvalidUrnError(f'PostUrn id contains reserved characters')
3168
3213
 
3169
3214
  super().__init__(self.ENTITY_TYPE, [id])
3170
3215
 
3171
3216
  @classmethod
3172
- def _parse_ids(cls, entity_ids: List[str]) -> "EntityTypeUrn":
3217
+ def _parse_ids(cls, entity_ids: List[str]) -> "PostUrn":
3173
3218
  if len(entity_ids) != cls.URN_PARTS:
3174
- raise InvalidUrnError(f"EntityTypeUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
3219
+ raise InvalidUrnError(f"PostUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
3175
3220
  return cls(id=entity_ids[0], _allow_coercion=False)
3176
3221
 
3177
3222
  @classmethod
3178
- def underlying_key_aspect_type(cls) -> Type["EntityTypeKeyClass"]:
3179
- from datahub.metadata.schema_classes import EntityTypeKeyClass
3223
+ def underlying_key_aspect_type(cls) -> Type["PostKeyClass"]:
3224
+ from datahub.metadata.schema_classes import PostKeyClass
3180
3225
 
3181
- return EntityTypeKeyClass
3226
+ return PostKeyClass
3182
3227
 
3183
- def to_key_aspect(self) -> "EntityTypeKeyClass":
3184
- from datahub.metadata.schema_classes import EntityTypeKeyClass
3228
+ def to_key_aspect(self) -> "PostKeyClass":
3229
+ from datahub.metadata.schema_classes import PostKeyClass
3185
3230
 
3186
- return EntityTypeKeyClass(id=self.id)
3231
+ return PostKeyClass(id=self.id)
3187
3232
 
3188
3233
  @classmethod
3189
- def from_key_aspect(cls, key_aspect: "EntityTypeKeyClass") -> "EntityTypeUrn":
3234
+ def from_key_aspect(cls, key_aspect: "PostKeyClass") -> "PostUrn":
3190
3235
  return cls(id=key_aspect.id)
3191
3236
 
3192
3237
  @property
@@ -3194,10 +3239,10 @@ class EntityTypeUrn(_SpecificUrn):
3194
3239
  return self.entity_ids[0]
3195
3240
 
3196
3241
  if TYPE_CHECKING:
3197
- from datahub.metadata.schema_classes import PlatformResourceKeyClass
3242
+ from datahub.metadata.schema_classes import DataTypeKeyClass
3198
3243
 
3199
- class PlatformResourceUrn(_SpecificUrn):
3200
- ENTITY_TYPE: ClassVar[str] = "platformResource"
3244
+ class DataTypeUrn(_SpecificUrn):
3245
+ ENTITY_TYPE: ClassVar[str] = "dataType"
3201
3246
  URN_PARTS: ClassVar[int] = 1
3202
3247
 
3203
3248
  def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
@@ -3207,31 +3252,31 @@ class PlatformResourceUrn(_SpecificUrn):
3207
3252
 
3208
3253
  # Validation logic.
3209
3254
  if not id:
3210
- raise InvalidUrnError("PlatformResourceUrn id cannot be empty")
3255
+ raise InvalidUrnError("DataTypeUrn id cannot be empty")
3211
3256
  if UrnEncoder.contains_reserved_char(id):
3212
- raise InvalidUrnError(f'PlatformResourceUrn id contains reserved characters')
3257
+ raise InvalidUrnError(f'DataTypeUrn id contains reserved characters')
3213
3258
 
3214
3259
  super().__init__(self.ENTITY_TYPE, [id])
3215
3260
 
3216
3261
  @classmethod
3217
- def _parse_ids(cls, entity_ids: List[str]) -> "PlatformResourceUrn":
3262
+ def _parse_ids(cls, entity_ids: List[str]) -> "DataTypeUrn":
3218
3263
  if len(entity_ids) != cls.URN_PARTS:
3219
- raise InvalidUrnError(f"PlatformResourceUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
3264
+ raise InvalidUrnError(f"DataTypeUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
3220
3265
  return cls(id=entity_ids[0], _allow_coercion=False)
3221
3266
 
3222
3267
  @classmethod
3223
- def underlying_key_aspect_type(cls) -> Type["PlatformResourceKeyClass"]:
3224
- from datahub.metadata.schema_classes import PlatformResourceKeyClass
3268
+ def underlying_key_aspect_type(cls) -> Type["DataTypeKeyClass"]:
3269
+ from datahub.metadata.schema_classes import DataTypeKeyClass
3225
3270
 
3226
- return PlatformResourceKeyClass
3271
+ return DataTypeKeyClass
3227
3272
 
3228
- def to_key_aspect(self) -> "PlatformResourceKeyClass":
3229
- from datahub.metadata.schema_classes import PlatformResourceKeyClass
3273
+ def to_key_aspect(self) -> "DataTypeKeyClass":
3274
+ from datahub.metadata.schema_classes import DataTypeKeyClass
3230
3275
 
3231
- return PlatformResourceKeyClass(id=self.id)
3276
+ return DataTypeKeyClass(id=self.id)
3232
3277
 
3233
3278
  @classmethod
3234
- def from_key_aspect(cls, key_aspect: "PlatformResourceKeyClass") -> "PlatformResourceUrn":
3279
+ def from_key_aspect(cls, key_aspect: "DataTypeKeyClass") -> "DataTypeUrn":
3235
3280
  return cls(id=key_aspect.id)
3236
3281
 
3237
3282
  @property