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