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