acryl-datahub-cloud 0.3.7.8rc4__py3-none-any.whl → 0.3.7.8.1__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.

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