acryl-datahub-cloud 0.3.6.10__py3-none-any.whl → 0.3.7__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.
- acryl_datahub_cloud/_codegen_config.json +1 -1
- acryl_datahub_cloud/datahub_reporting/extract_graph.py +1 -1
- acryl_datahub_cloud/datahub_usage_reporting/usage_feature_patch_builder.py +466 -0
- acryl_datahub_cloud/datahub_usage_reporting/usage_feature_reporter.py +432 -34
- acryl_datahub_cloud/metadata/_urns/urn_defs.py +788 -5
- acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/actionrequest/__init__.py +2 -0
- acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/ai/__init__.py +23 -0
- acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/assertion/__init__.py +4 -0
- acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/structured/__init__.py +2 -0
- acryl_datahub_cloud/metadata/schema.avsc +773 -75
- acryl_datahub_cloud/metadata/schema_classes.py +750 -20
- acryl_datahub_cloud/metadata/schemas/Access.avsc +2 -1
- acryl_datahub_cloud/metadata/schemas/ActionRequestInfo.avsc +76 -0
- acryl_datahub_cloud/metadata/schemas/AiInferenceMetadata.avsc +42 -0
- acryl_datahub_cloud/metadata/schemas/AnomaliesSummary.avsc +16 -8
- acryl_datahub_cloud/metadata/schemas/AssertionAnalyticsRunEvent.avsc +3506 -0
- acryl_datahub_cloud/metadata/schemas/AssertionInfo.avsc +3 -2
- acryl_datahub_cloud/metadata/schemas/AssertionKey.avsc +2 -0
- acryl_datahub_cloud/metadata/schemas/AssertionRunEvent.avsc +4 -3
- acryl_datahub_cloud/metadata/schemas/AssertionSummary.avsc +50 -0
- acryl_datahub_cloud/metadata/schemas/AssertionsSummary.avsc +54 -8
- acryl_datahub_cloud/metadata/schemas/ConstraintInfo.avsc +4 -2
- acryl_datahub_cloud/metadata/schemas/ContainerKey.avsc +1 -0
- acryl_datahub_cloud/metadata/schemas/ContainerProperties.avsc +3 -1
- acryl_datahub_cloud/metadata/schemas/CorpUserInfo.avsc +1 -1
- acryl_datahub_cloud/metadata/schemas/DashboardInfo.avsc +29 -2
- acryl_datahub_cloud/metadata/schemas/DataFlowInfo.avsc +3 -1
- acryl_datahub_cloud/metadata/schemas/DataHubActionInfo.avsc +10 -1
- acryl_datahub_cloud/metadata/schemas/DataHubPolicyInfo.avsc +4 -2
- acryl_datahub_cloud/metadata/schemas/DataHubViewInfo.avsc +2 -0
- acryl_datahub_cloud/metadata/schemas/DataJobInfo.avsc +3 -1
- acryl_datahub_cloud/metadata/schemas/DataProcessKey.avsc +3 -1
- acryl_datahub_cloud/metadata/schemas/DatasetKey.avsc +5 -2
- acryl_datahub_cloud/metadata/schemas/DynamicFormAssignment.avsc +2 -0
- acryl_datahub_cloud/metadata/schemas/EntityInferenceMetadata.avsc +47 -0
- acryl_datahub_cloud/metadata/schemas/Filter.avsc +2 -0
- acryl_datahub_cloud/metadata/schemas/FormInfo.avsc +75 -0
- acryl_datahub_cloud/metadata/schemas/Forms.avsc +18 -9
- acryl_datahub_cloud/metadata/schemas/GlobalSettingsInfo.avsc +18 -0
- acryl_datahub_cloud/metadata/schemas/GlossaryRelatedTerms.avsc +4 -4
- acryl_datahub_cloud/metadata/schemas/IncidentActivityEvent.avsc +3 -1
- acryl_datahub_cloud/metadata/schemas/IncidentInfo.avsc +3 -1
- acryl_datahub_cloud/metadata/schemas/IncidentsSummary.avsc +4 -2
- acryl_datahub_cloud/metadata/schemas/InferredMetadata.avsc +4 -2
- acryl_datahub_cloud/metadata/schemas/MLFeatureKey.avsc +2 -1
- acryl_datahub_cloud/metadata/schemas/MLModelDeploymentKey.avsc +3 -1
- acryl_datahub_cloud/metadata/schemas/MLModelGroupKey.avsc +3 -1
- acryl_datahub_cloud/metadata/schemas/MLModelKey.avsc +5 -2
- acryl_datahub_cloud/metadata/schemas/MetadataChangeEvent.avsc +119 -11
- acryl_datahub_cloud/metadata/schemas/MonitorInfo.avsc +3 -2
- acryl_datahub_cloud/metadata/schemas/NotificationRequest.avsc +2 -1
- acryl_datahub_cloud/metadata/schemas/Operation.avsc +0 -3
- acryl_datahub_cloud/metadata/schemas/Ownership.avsc +2 -1
- acryl_datahub_cloud/metadata/schemas/PlatformResourceInfo.avsc +2 -2
- acryl_datahub_cloud/metadata/schemas/PlatformResourceKey.avsc +4 -3
- acryl_datahub_cloud/metadata/schemas/PostInfo.avsc +2 -1
- acryl_datahub_cloud/metadata/schemas/RecommendationModule.avsc +2 -0
- acryl_datahub_cloud/metadata/schemas/Share.avsc +2 -1
- acryl_datahub_cloud/metadata/schemas/StructuredPropertyDefinition.avsc +25 -1
- acryl_datahub_cloud/metadata/schemas/SubTypes.avsc +1 -1
- acryl_datahub_cloud/metadata/schemas/TestResults.avsc +8 -4
- {acryl_datahub_cloud-0.3.6.10.dist-info → acryl_datahub_cloud-0.3.7.dist-info}/METADATA +36 -36
- {acryl_datahub_cloud-0.3.6.10.dist-info → acryl_datahub_cloud-0.3.7.dist-info}/RECORD +66 -60
- {acryl_datahub_cloud-0.3.6.10.dist-info → acryl_datahub_cloud-0.3.7.dist-info}/WHEEL +1 -1
- {acryl_datahub_cloud-0.3.6.10.dist-info → acryl_datahub_cloud-0.3.7.dist-info}/entry_points.txt +0 -0
- {acryl_datahub_cloud-0.3.6.10.dist-info → acryl_datahub_cloud-0.3.7.dist-info}/top_level.txt +0 -0
|
@@ -21,6 +21,51 @@ from datahub.utilities.urns.error import InvalidUrnError
|
|
|
21
21
|
|
|
22
22
|
deprecated = functools.partial(_sphinx_deprecated, version="0.12.0.2")
|
|
23
23
|
|
|
24
|
+
if TYPE_CHECKING:
|
|
25
|
+
from datahub.metadata.schema_classes import DataHubConnectionKeyClass
|
|
26
|
+
|
|
27
|
+
class DataHubConnectionUrn(_SpecificUrn):
|
|
28
|
+
ENTITY_TYPE: ClassVar[str] = "dataHubConnection"
|
|
29
|
+
URN_PARTS: ClassVar[int] = 1
|
|
30
|
+
|
|
31
|
+
def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
|
|
32
|
+
if _allow_coercion:
|
|
33
|
+
# Field coercion logic (if any is required).
|
|
34
|
+
id = UrnEncoder.encode_string(id)
|
|
35
|
+
|
|
36
|
+
# Validation logic.
|
|
37
|
+
if not id:
|
|
38
|
+
raise InvalidUrnError("DataHubConnectionUrn id cannot be empty")
|
|
39
|
+
if UrnEncoder.contains_reserved_char(id):
|
|
40
|
+
raise InvalidUrnError(f'DataHubConnectionUrn id contains reserved characters')
|
|
41
|
+
|
|
42
|
+
super().__init__(self.ENTITY_TYPE, [id])
|
|
43
|
+
|
|
44
|
+
@classmethod
|
|
45
|
+
def _parse_ids(cls, entity_ids: List[str]) -> "DataHubConnectionUrn":
|
|
46
|
+
if len(entity_ids) != cls.URN_PARTS:
|
|
47
|
+
raise InvalidUrnError(f"DataHubConnectionUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
|
|
48
|
+
return cls(id=entity_ids[0], _allow_coercion=False)
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def underlying_key_aspect_type(cls) -> Type["DataHubConnectionKeyClass"]:
|
|
52
|
+
from datahub.metadata.schema_classes import DataHubConnectionKeyClass
|
|
53
|
+
|
|
54
|
+
return DataHubConnectionKeyClass
|
|
55
|
+
|
|
56
|
+
def to_key_aspect(self) -> "DataHubConnectionKeyClass":
|
|
57
|
+
from datahub.metadata.schema_classes import DataHubConnectionKeyClass
|
|
58
|
+
|
|
59
|
+
return DataHubConnectionKeyClass(id=self.id)
|
|
60
|
+
|
|
61
|
+
@classmethod
|
|
62
|
+
def from_key_aspect(cls, key_aspect: "DataHubConnectionKeyClass") -> "DataHubConnectionUrn":
|
|
63
|
+
return cls(id=key_aspect.id)
|
|
64
|
+
|
|
65
|
+
@property
|
|
66
|
+
def id(self) -> str:
|
|
67
|
+
return self.entity_ids[0]
|
|
68
|
+
|
|
24
69
|
if TYPE_CHECKING:
|
|
25
70
|
from datahub.metadata.schema_classes import DataHubRoleKeyClass
|
|
26
71
|
|
|
@@ -66,6 +111,96 @@ class DataHubRoleUrn(_SpecificUrn):
|
|
|
66
111
|
def id(self) -> str:
|
|
67
112
|
return self.entity_ids[0]
|
|
68
113
|
|
|
114
|
+
if TYPE_CHECKING:
|
|
115
|
+
from datahub.metadata.schema_classes import ActionRequestKeyClass
|
|
116
|
+
|
|
117
|
+
class ActionRequestUrn(_SpecificUrn):
|
|
118
|
+
ENTITY_TYPE: ClassVar[str] = "actionRequest"
|
|
119
|
+
URN_PARTS: ClassVar[int] = 1
|
|
120
|
+
|
|
121
|
+
def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
|
|
122
|
+
if _allow_coercion:
|
|
123
|
+
# Field coercion logic (if any is required).
|
|
124
|
+
id = UrnEncoder.encode_string(id)
|
|
125
|
+
|
|
126
|
+
# Validation logic.
|
|
127
|
+
if not id:
|
|
128
|
+
raise InvalidUrnError("ActionRequestUrn id cannot be empty")
|
|
129
|
+
if UrnEncoder.contains_reserved_char(id):
|
|
130
|
+
raise InvalidUrnError(f'ActionRequestUrn id contains reserved characters')
|
|
131
|
+
|
|
132
|
+
super().__init__(self.ENTITY_TYPE, [id])
|
|
133
|
+
|
|
134
|
+
@classmethod
|
|
135
|
+
def _parse_ids(cls, entity_ids: List[str]) -> "ActionRequestUrn":
|
|
136
|
+
if len(entity_ids) != cls.URN_PARTS:
|
|
137
|
+
raise InvalidUrnError(f"ActionRequestUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
|
|
138
|
+
return cls(id=entity_ids[0], _allow_coercion=False)
|
|
139
|
+
|
|
140
|
+
@classmethod
|
|
141
|
+
def underlying_key_aspect_type(cls) -> Type["ActionRequestKeyClass"]:
|
|
142
|
+
from datahub.metadata.schema_classes import ActionRequestKeyClass
|
|
143
|
+
|
|
144
|
+
return ActionRequestKeyClass
|
|
145
|
+
|
|
146
|
+
def to_key_aspect(self) -> "ActionRequestKeyClass":
|
|
147
|
+
from datahub.metadata.schema_classes import ActionRequestKeyClass
|
|
148
|
+
|
|
149
|
+
return ActionRequestKeyClass(id=self.id)
|
|
150
|
+
|
|
151
|
+
@classmethod
|
|
152
|
+
def from_key_aspect(cls, key_aspect: "ActionRequestKeyClass") -> "ActionRequestUrn":
|
|
153
|
+
return cls(id=key_aspect.id)
|
|
154
|
+
|
|
155
|
+
@property
|
|
156
|
+
def id(self) -> str:
|
|
157
|
+
return self.entity_ids[0]
|
|
158
|
+
|
|
159
|
+
if TYPE_CHECKING:
|
|
160
|
+
from datahub.metadata.schema_classes import DataHubIngestionSourceKeyClass
|
|
161
|
+
|
|
162
|
+
class DataHubIngestionSourceUrn(_SpecificUrn):
|
|
163
|
+
ENTITY_TYPE: ClassVar[str] = "dataHubIngestionSource"
|
|
164
|
+
URN_PARTS: ClassVar[int] = 1
|
|
165
|
+
|
|
166
|
+
def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
|
|
167
|
+
if _allow_coercion:
|
|
168
|
+
# Field coercion logic (if any is required).
|
|
169
|
+
id = UrnEncoder.encode_string(id)
|
|
170
|
+
|
|
171
|
+
# Validation logic.
|
|
172
|
+
if not id:
|
|
173
|
+
raise InvalidUrnError("DataHubIngestionSourceUrn id cannot be empty")
|
|
174
|
+
if UrnEncoder.contains_reserved_char(id):
|
|
175
|
+
raise InvalidUrnError(f'DataHubIngestionSourceUrn id contains reserved characters')
|
|
176
|
+
|
|
177
|
+
super().__init__(self.ENTITY_TYPE, [id])
|
|
178
|
+
|
|
179
|
+
@classmethod
|
|
180
|
+
def _parse_ids(cls, entity_ids: List[str]) -> "DataHubIngestionSourceUrn":
|
|
181
|
+
if len(entity_ids) != cls.URN_PARTS:
|
|
182
|
+
raise InvalidUrnError(f"DataHubIngestionSourceUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
|
|
183
|
+
return cls(id=entity_ids[0], _allow_coercion=False)
|
|
184
|
+
|
|
185
|
+
@classmethod
|
|
186
|
+
def underlying_key_aspect_type(cls) -> Type["DataHubIngestionSourceKeyClass"]:
|
|
187
|
+
from datahub.metadata.schema_classes import DataHubIngestionSourceKeyClass
|
|
188
|
+
|
|
189
|
+
return DataHubIngestionSourceKeyClass
|
|
190
|
+
|
|
191
|
+
def to_key_aspect(self) -> "DataHubIngestionSourceKeyClass":
|
|
192
|
+
from datahub.metadata.schema_classes import DataHubIngestionSourceKeyClass
|
|
193
|
+
|
|
194
|
+
return DataHubIngestionSourceKeyClass(id=self.id)
|
|
195
|
+
|
|
196
|
+
@classmethod
|
|
197
|
+
def from_key_aspect(cls, key_aspect: "DataHubIngestionSourceKeyClass") -> "DataHubIngestionSourceUrn":
|
|
198
|
+
return cls(id=key_aspect.id)
|
|
199
|
+
|
|
200
|
+
@property
|
|
201
|
+
def id(self) -> str:
|
|
202
|
+
return self.entity_ids[0]
|
|
203
|
+
|
|
69
204
|
if TYPE_CHECKING:
|
|
70
205
|
from datahub.metadata.schema_classes import FormKeyClass
|
|
71
206
|
|
|
@@ -218,6 +353,60 @@ class GlossaryNodeUrn(_SpecificUrn):
|
|
|
218
353
|
def name(self) -> str:
|
|
219
354
|
return self.entity_ids[0]
|
|
220
355
|
|
|
356
|
+
if TYPE_CHECKING:
|
|
357
|
+
from datahub.metadata.schema_classes import DataPlatformInstanceKeyClass
|
|
358
|
+
|
|
359
|
+
class DataPlatformInstanceUrn(_SpecificUrn):
|
|
360
|
+
ENTITY_TYPE: ClassVar[str] = "dataPlatformInstance"
|
|
361
|
+
URN_PARTS: ClassVar[int] = 2
|
|
362
|
+
|
|
363
|
+
def __init__(self, platform: str, instance: str, *, _allow_coercion: bool = True) -> None:
|
|
364
|
+
if _allow_coercion:
|
|
365
|
+
# Field coercion logic (if any is required).
|
|
366
|
+
platform = DataPlatformUrn(platform).urn()
|
|
367
|
+
instance = UrnEncoder.encode_string(instance)
|
|
368
|
+
|
|
369
|
+
# Validation logic.
|
|
370
|
+
if not platform:
|
|
371
|
+
raise InvalidUrnError("DataPlatformInstanceUrn platform cannot be empty")
|
|
372
|
+
platform = str(platform)
|
|
373
|
+
assert DataPlatformUrn.from_string(platform)
|
|
374
|
+
if not instance:
|
|
375
|
+
raise InvalidUrnError("DataPlatformInstanceUrn instance cannot be empty")
|
|
376
|
+
if UrnEncoder.contains_reserved_char(instance):
|
|
377
|
+
raise InvalidUrnError(f'DataPlatformInstanceUrn instance contains reserved characters')
|
|
378
|
+
|
|
379
|
+
super().__init__(self.ENTITY_TYPE, [platform, instance])
|
|
380
|
+
|
|
381
|
+
@classmethod
|
|
382
|
+
def _parse_ids(cls, entity_ids: List[str]) -> "DataPlatformInstanceUrn":
|
|
383
|
+
if len(entity_ids) != cls.URN_PARTS:
|
|
384
|
+
raise InvalidUrnError(f"DataPlatformInstanceUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
|
|
385
|
+
return cls(platform=entity_ids[0], instance=entity_ids[1], _allow_coercion=False)
|
|
386
|
+
|
|
387
|
+
@classmethod
|
|
388
|
+
def underlying_key_aspect_type(cls) -> Type["DataPlatformInstanceKeyClass"]:
|
|
389
|
+
from datahub.metadata.schema_classes import DataPlatformInstanceKeyClass
|
|
390
|
+
|
|
391
|
+
return DataPlatformInstanceKeyClass
|
|
392
|
+
|
|
393
|
+
def to_key_aspect(self) -> "DataPlatformInstanceKeyClass":
|
|
394
|
+
from datahub.metadata.schema_classes import DataPlatformInstanceKeyClass
|
|
395
|
+
|
|
396
|
+
return DataPlatformInstanceKeyClass(platform=self.platform, instance=self.instance)
|
|
397
|
+
|
|
398
|
+
@classmethod
|
|
399
|
+
def from_key_aspect(cls, key_aspect: "DataPlatformInstanceKeyClass") -> "DataPlatformInstanceUrn":
|
|
400
|
+
return cls(platform=key_aspect.platform, instance=key_aspect.instance)
|
|
401
|
+
|
|
402
|
+
@property
|
|
403
|
+
def platform(self) -> str:
|
|
404
|
+
return self.entity_ids[0]
|
|
405
|
+
|
|
406
|
+
@property
|
|
407
|
+
def instance(self) -> str:
|
|
408
|
+
return self.entity_ids[1]
|
|
409
|
+
|
|
221
410
|
if TYPE_CHECKING:
|
|
222
411
|
from datahub.metadata.schema_classes import RoleKeyClass
|
|
223
412
|
|
|
@@ -497,6 +686,105 @@ class ContainerUrn(_SpecificUrn):
|
|
|
497
686
|
def guid(self) -> str:
|
|
498
687
|
return self.entity_ids[0]
|
|
499
688
|
|
|
689
|
+
if TYPE_CHECKING:
|
|
690
|
+
from datahub.metadata.schema_classes import DataHubRetentionKeyClass
|
|
691
|
+
|
|
692
|
+
class DataHubRetentionUrn(_SpecificUrn):
|
|
693
|
+
ENTITY_TYPE: ClassVar[str] = "dataHubRetention"
|
|
694
|
+
URN_PARTS: ClassVar[int] = 2
|
|
695
|
+
|
|
696
|
+
def __init__(self, entity_name: str, aspect_name: str, *, _allow_coercion: bool = True) -> None:
|
|
697
|
+
if _allow_coercion:
|
|
698
|
+
# Field coercion logic (if any is required).
|
|
699
|
+
entity_name = UrnEncoder.encode_string(entity_name)
|
|
700
|
+
aspect_name = UrnEncoder.encode_string(aspect_name)
|
|
701
|
+
|
|
702
|
+
# Validation logic.
|
|
703
|
+
if not entity_name:
|
|
704
|
+
raise InvalidUrnError("DataHubRetentionUrn entity_name cannot be empty")
|
|
705
|
+
if UrnEncoder.contains_reserved_char(entity_name):
|
|
706
|
+
raise InvalidUrnError(f'DataHubRetentionUrn entity_name contains reserved characters')
|
|
707
|
+
if not aspect_name:
|
|
708
|
+
raise InvalidUrnError("DataHubRetentionUrn aspect_name cannot be empty")
|
|
709
|
+
if UrnEncoder.contains_reserved_char(aspect_name):
|
|
710
|
+
raise InvalidUrnError(f'DataHubRetentionUrn aspect_name contains reserved characters')
|
|
711
|
+
|
|
712
|
+
super().__init__(self.ENTITY_TYPE, [entity_name, aspect_name])
|
|
713
|
+
|
|
714
|
+
@classmethod
|
|
715
|
+
def _parse_ids(cls, entity_ids: List[str]) -> "DataHubRetentionUrn":
|
|
716
|
+
if len(entity_ids) != cls.URN_PARTS:
|
|
717
|
+
raise InvalidUrnError(f"DataHubRetentionUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
|
|
718
|
+
return cls(entity_name=entity_ids[0], aspect_name=entity_ids[1], _allow_coercion=False)
|
|
719
|
+
|
|
720
|
+
@classmethod
|
|
721
|
+
def underlying_key_aspect_type(cls) -> Type["DataHubRetentionKeyClass"]:
|
|
722
|
+
from datahub.metadata.schema_classes import DataHubRetentionKeyClass
|
|
723
|
+
|
|
724
|
+
return DataHubRetentionKeyClass
|
|
725
|
+
|
|
726
|
+
def to_key_aspect(self) -> "DataHubRetentionKeyClass":
|
|
727
|
+
from datahub.metadata.schema_classes import DataHubRetentionKeyClass
|
|
728
|
+
|
|
729
|
+
return DataHubRetentionKeyClass(entityName=self.entity_name, aspectName=self.aspect_name)
|
|
730
|
+
|
|
731
|
+
@classmethod
|
|
732
|
+
def from_key_aspect(cls, key_aspect: "DataHubRetentionKeyClass") -> "DataHubRetentionUrn":
|
|
733
|
+
return cls(entity_name=key_aspect.entityName, aspect_name=key_aspect.aspectName)
|
|
734
|
+
|
|
735
|
+
@property
|
|
736
|
+
def entity_name(self) -> str:
|
|
737
|
+
return self.entity_ids[0]
|
|
738
|
+
|
|
739
|
+
@property
|
|
740
|
+
def aspect_name(self) -> str:
|
|
741
|
+
return self.entity_ids[1]
|
|
742
|
+
|
|
743
|
+
if TYPE_CHECKING:
|
|
744
|
+
from datahub.metadata.schema_classes import LinkPreviewKeyClass
|
|
745
|
+
|
|
746
|
+
class LinkPreviewUrn(_SpecificUrn):
|
|
747
|
+
ENTITY_TYPE: ClassVar[str] = "linkPreview"
|
|
748
|
+
URN_PARTS: ClassVar[int] = 1
|
|
749
|
+
|
|
750
|
+
def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
|
|
751
|
+
if _allow_coercion:
|
|
752
|
+
# Field coercion logic (if any is required).
|
|
753
|
+
id = UrnEncoder.encode_string(id)
|
|
754
|
+
|
|
755
|
+
# Validation logic.
|
|
756
|
+
if not id:
|
|
757
|
+
raise InvalidUrnError("LinkPreviewUrn id cannot be empty")
|
|
758
|
+
if UrnEncoder.contains_reserved_char(id):
|
|
759
|
+
raise InvalidUrnError(f'LinkPreviewUrn id contains reserved characters')
|
|
760
|
+
|
|
761
|
+
super().__init__(self.ENTITY_TYPE, [id])
|
|
762
|
+
|
|
763
|
+
@classmethod
|
|
764
|
+
def _parse_ids(cls, entity_ids: List[str]) -> "LinkPreviewUrn":
|
|
765
|
+
if len(entity_ids) != cls.URN_PARTS:
|
|
766
|
+
raise InvalidUrnError(f"LinkPreviewUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
|
|
767
|
+
return cls(id=entity_ids[0], _allow_coercion=False)
|
|
768
|
+
|
|
769
|
+
@classmethod
|
|
770
|
+
def underlying_key_aspect_type(cls) -> Type["LinkPreviewKeyClass"]:
|
|
771
|
+
from datahub.metadata.schema_classes import LinkPreviewKeyClass
|
|
772
|
+
|
|
773
|
+
return LinkPreviewKeyClass
|
|
774
|
+
|
|
775
|
+
def to_key_aspect(self) -> "LinkPreviewKeyClass":
|
|
776
|
+
from datahub.metadata.schema_classes import LinkPreviewKeyClass
|
|
777
|
+
|
|
778
|
+
return LinkPreviewKeyClass(id=self.id)
|
|
779
|
+
|
|
780
|
+
@classmethod
|
|
781
|
+
def from_key_aspect(cls, key_aspect: "LinkPreviewKeyClass") -> "LinkPreviewUrn":
|
|
782
|
+
return cls(id=key_aspect.id)
|
|
783
|
+
|
|
784
|
+
@property
|
|
785
|
+
def id(self) -> str:
|
|
786
|
+
return self.entity_ids[0]
|
|
787
|
+
|
|
500
788
|
if TYPE_CHECKING:
|
|
501
789
|
from datahub.metadata.schema_classes import PostKeyClass
|
|
502
790
|
|
|
@@ -542,6 +830,96 @@ class PostUrn(_SpecificUrn):
|
|
|
542
830
|
def id(self) -> str:
|
|
543
831
|
return self.entity_ids[0]
|
|
544
832
|
|
|
833
|
+
if TYPE_CHECKING:
|
|
834
|
+
from datahub.metadata.schema_classes import DataHubSecretKeyClass
|
|
835
|
+
|
|
836
|
+
class DataHubSecretUrn(_SpecificUrn):
|
|
837
|
+
ENTITY_TYPE: ClassVar[str] = "dataHubSecret"
|
|
838
|
+
URN_PARTS: ClassVar[int] = 1
|
|
839
|
+
|
|
840
|
+
def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
|
|
841
|
+
if _allow_coercion:
|
|
842
|
+
# Field coercion logic (if any is required).
|
|
843
|
+
id = UrnEncoder.encode_string(id)
|
|
844
|
+
|
|
845
|
+
# Validation logic.
|
|
846
|
+
if not id:
|
|
847
|
+
raise InvalidUrnError("DataHubSecretUrn id cannot be empty")
|
|
848
|
+
if UrnEncoder.contains_reserved_char(id):
|
|
849
|
+
raise InvalidUrnError(f'DataHubSecretUrn id contains reserved characters')
|
|
850
|
+
|
|
851
|
+
super().__init__(self.ENTITY_TYPE, [id])
|
|
852
|
+
|
|
853
|
+
@classmethod
|
|
854
|
+
def _parse_ids(cls, entity_ids: List[str]) -> "DataHubSecretUrn":
|
|
855
|
+
if len(entity_ids) != cls.URN_PARTS:
|
|
856
|
+
raise InvalidUrnError(f"DataHubSecretUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
|
|
857
|
+
return cls(id=entity_ids[0], _allow_coercion=False)
|
|
858
|
+
|
|
859
|
+
@classmethod
|
|
860
|
+
def underlying_key_aspect_type(cls) -> Type["DataHubSecretKeyClass"]:
|
|
861
|
+
from datahub.metadata.schema_classes import DataHubSecretKeyClass
|
|
862
|
+
|
|
863
|
+
return DataHubSecretKeyClass
|
|
864
|
+
|
|
865
|
+
def to_key_aspect(self) -> "DataHubSecretKeyClass":
|
|
866
|
+
from datahub.metadata.schema_classes import DataHubSecretKeyClass
|
|
867
|
+
|
|
868
|
+
return DataHubSecretKeyClass(id=self.id)
|
|
869
|
+
|
|
870
|
+
@classmethod
|
|
871
|
+
def from_key_aspect(cls, key_aspect: "DataHubSecretKeyClass") -> "DataHubSecretUrn":
|
|
872
|
+
return cls(id=key_aspect.id)
|
|
873
|
+
|
|
874
|
+
@property
|
|
875
|
+
def id(self) -> str:
|
|
876
|
+
return self.entity_ids[0]
|
|
877
|
+
|
|
878
|
+
if TYPE_CHECKING:
|
|
879
|
+
from datahub.metadata.schema_classes import DataHubStepStateKeyClass
|
|
880
|
+
|
|
881
|
+
class DataHubStepStateUrn(_SpecificUrn):
|
|
882
|
+
ENTITY_TYPE: ClassVar[str] = "dataHubStepState"
|
|
883
|
+
URN_PARTS: ClassVar[int] = 1
|
|
884
|
+
|
|
885
|
+
def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
|
|
886
|
+
if _allow_coercion:
|
|
887
|
+
# Field coercion logic (if any is required).
|
|
888
|
+
id = UrnEncoder.encode_string(id)
|
|
889
|
+
|
|
890
|
+
# Validation logic.
|
|
891
|
+
if not id:
|
|
892
|
+
raise InvalidUrnError("DataHubStepStateUrn id cannot be empty")
|
|
893
|
+
if UrnEncoder.contains_reserved_char(id):
|
|
894
|
+
raise InvalidUrnError(f'DataHubStepStateUrn id contains reserved characters')
|
|
895
|
+
|
|
896
|
+
super().__init__(self.ENTITY_TYPE, [id])
|
|
897
|
+
|
|
898
|
+
@classmethod
|
|
899
|
+
def _parse_ids(cls, entity_ids: List[str]) -> "DataHubStepStateUrn":
|
|
900
|
+
if len(entity_ids) != cls.URN_PARTS:
|
|
901
|
+
raise InvalidUrnError(f"DataHubStepStateUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
|
|
902
|
+
return cls(id=entity_ids[0], _allow_coercion=False)
|
|
903
|
+
|
|
904
|
+
@classmethod
|
|
905
|
+
def underlying_key_aspect_type(cls) -> Type["DataHubStepStateKeyClass"]:
|
|
906
|
+
from datahub.metadata.schema_classes import DataHubStepStateKeyClass
|
|
907
|
+
|
|
908
|
+
return DataHubStepStateKeyClass
|
|
909
|
+
|
|
910
|
+
def to_key_aspect(self) -> "DataHubStepStateKeyClass":
|
|
911
|
+
from datahub.metadata.schema_classes import DataHubStepStateKeyClass
|
|
912
|
+
|
|
913
|
+
return DataHubStepStateKeyClass(id=self.id)
|
|
914
|
+
|
|
915
|
+
@classmethod
|
|
916
|
+
def from_key_aspect(cls, key_aspect: "DataHubStepStateKeyClass") -> "DataHubStepStateUrn":
|
|
917
|
+
return cls(id=key_aspect.id)
|
|
918
|
+
|
|
919
|
+
@property
|
|
920
|
+
def id(self) -> str:
|
|
921
|
+
return self.entity_ids[0]
|
|
922
|
+
|
|
545
923
|
if TYPE_CHECKING:
|
|
546
924
|
from datahub.metadata.schema_classes import OwnershipTypeKeyClass
|
|
547
925
|
|
|
@@ -689,13 +1067,58 @@ class DataJobUrn(_SpecificUrn):
|
|
|
689
1067
|
return self.job_id
|
|
690
1068
|
|
|
691
1069
|
@property
|
|
692
|
-
def flow(self) -> str:
|
|
1070
|
+
def flow(self) -> str:
|
|
1071
|
+
return self.entity_ids[0]
|
|
1072
|
+
|
|
1073
|
+
@property
|
|
1074
|
+
def job_id(self) -> str:
|
|
1075
|
+
return self.entity_ids[1]
|
|
1076
|
+
|
|
1077
|
+
if TYPE_CHECKING:
|
|
1078
|
+
from datahub.metadata.schema_classes import ExecutionRequestKeyClass
|
|
1079
|
+
|
|
1080
|
+
class DataHubExecutionRequestUrn(_SpecificUrn):
|
|
1081
|
+
ENTITY_TYPE: ClassVar[str] = "dataHubExecutionRequest"
|
|
1082
|
+
URN_PARTS: ClassVar[int] = 1
|
|
1083
|
+
|
|
1084
|
+
def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
|
|
1085
|
+
if _allow_coercion:
|
|
1086
|
+
# Field coercion logic (if any is required).
|
|
1087
|
+
id = UrnEncoder.encode_string(id)
|
|
1088
|
+
|
|
1089
|
+
# Validation logic.
|
|
1090
|
+
if not id:
|
|
1091
|
+
raise InvalidUrnError("DataHubExecutionRequestUrn id cannot be empty")
|
|
1092
|
+
if UrnEncoder.contains_reserved_char(id):
|
|
1093
|
+
raise InvalidUrnError(f'DataHubExecutionRequestUrn id contains reserved characters')
|
|
1094
|
+
|
|
1095
|
+
super().__init__(self.ENTITY_TYPE, [id])
|
|
1096
|
+
|
|
1097
|
+
@classmethod
|
|
1098
|
+
def _parse_ids(cls, entity_ids: List[str]) -> "DataHubExecutionRequestUrn":
|
|
1099
|
+
if len(entity_ids) != cls.URN_PARTS:
|
|
1100
|
+
raise InvalidUrnError(f"DataHubExecutionRequestUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
|
|
1101
|
+
return cls(id=entity_ids[0], _allow_coercion=False)
|
|
1102
|
+
|
|
1103
|
+
@classmethod
|
|
1104
|
+
def underlying_key_aspect_type(cls) -> Type["ExecutionRequestKeyClass"]:
|
|
1105
|
+
from datahub.metadata.schema_classes import ExecutionRequestKeyClass
|
|
1106
|
+
|
|
1107
|
+
return ExecutionRequestKeyClass
|
|
1108
|
+
|
|
1109
|
+
def to_key_aspect(self) -> "ExecutionRequestKeyClass":
|
|
1110
|
+
from datahub.metadata.schema_classes import ExecutionRequestKeyClass
|
|
1111
|
+
|
|
1112
|
+
return ExecutionRequestKeyClass(id=self.id)
|
|
1113
|
+
|
|
1114
|
+
@classmethod
|
|
1115
|
+
def from_key_aspect(cls, key_aspect: "ExecutionRequestKeyClass") -> "DataHubExecutionRequestUrn":
|
|
1116
|
+
return cls(id=key_aspect.id)
|
|
1117
|
+
|
|
1118
|
+
@property
|
|
1119
|
+
def id(self) -> str:
|
|
693
1120
|
return self.entity_ids[0]
|
|
694
1121
|
|
|
695
|
-
@property
|
|
696
|
-
def job_id(self) -> str:
|
|
697
|
-
return self.entity_ids[1]
|
|
698
|
-
|
|
699
1122
|
if TYPE_CHECKING:
|
|
700
1123
|
from datahub.metadata.schema_classes import SubscriptionKeyClass
|
|
701
1124
|
|
|
@@ -1116,6 +1539,96 @@ class CorpGroupUrn(_SpecificUrn):
|
|
|
1116
1539
|
def name(self) -> str:
|
|
1117
1540
|
return self.entity_ids[0]
|
|
1118
1541
|
|
|
1542
|
+
if TYPE_CHECKING:
|
|
1543
|
+
from datahub.metadata.schema_classes import DataHubUpgradeKeyClass
|
|
1544
|
+
|
|
1545
|
+
class DataHubUpgradeUrn(_SpecificUrn):
|
|
1546
|
+
ENTITY_TYPE: ClassVar[str] = "dataHubUpgrade"
|
|
1547
|
+
URN_PARTS: ClassVar[int] = 1
|
|
1548
|
+
|
|
1549
|
+
def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
|
|
1550
|
+
if _allow_coercion:
|
|
1551
|
+
# Field coercion logic (if any is required).
|
|
1552
|
+
id = UrnEncoder.encode_string(id)
|
|
1553
|
+
|
|
1554
|
+
# Validation logic.
|
|
1555
|
+
if not id:
|
|
1556
|
+
raise InvalidUrnError("DataHubUpgradeUrn id cannot be empty")
|
|
1557
|
+
if UrnEncoder.contains_reserved_char(id):
|
|
1558
|
+
raise InvalidUrnError(f'DataHubUpgradeUrn id contains reserved characters')
|
|
1559
|
+
|
|
1560
|
+
super().__init__(self.ENTITY_TYPE, [id])
|
|
1561
|
+
|
|
1562
|
+
@classmethod
|
|
1563
|
+
def _parse_ids(cls, entity_ids: List[str]) -> "DataHubUpgradeUrn":
|
|
1564
|
+
if len(entity_ids) != cls.URN_PARTS:
|
|
1565
|
+
raise InvalidUrnError(f"DataHubUpgradeUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
|
|
1566
|
+
return cls(id=entity_ids[0], _allow_coercion=False)
|
|
1567
|
+
|
|
1568
|
+
@classmethod
|
|
1569
|
+
def underlying_key_aspect_type(cls) -> Type["DataHubUpgradeKeyClass"]:
|
|
1570
|
+
from datahub.metadata.schema_classes import DataHubUpgradeKeyClass
|
|
1571
|
+
|
|
1572
|
+
return DataHubUpgradeKeyClass
|
|
1573
|
+
|
|
1574
|
+
def to_key_aspect(self) -> "DataHubUpgradeKeyClass":
|
|
1575
|
+
from datahub.metadata.schema_classes import DataHubUpgradeKeyClass
|
|
1576
|
+
|
|
1577
|
+
return DataHubUpgradeKeyClass(id=self.id)
|
|
1578
|
+
|
|
1579
|
+
@classmethod
|
|
1580
|
+
def from_key_aspect(cls, key_aspect: "DataHubUpgradeKeyClass") -> "DataHubUpgradeUrn":
|
|
1581
|
+
return cls(id=key_aspect.id)
|
|
1582
|
+
|
|
1583
|
+
@property
|
|
1584
|
+
def id(self) -> str:
|
|
1585
|
+
return self.entity_ids[0]
|
|
1586
|
+
|
|
1587
|
+
if TYPE_CHECKING:
|
|
1588
|
+
from datahub.metadata.schema_classes import GlobalSettingsKeyClass
|
|
1589
|
+
|
|
1590
|
+
class GlobalSettingsUrn(_SpecificUrn):
|
|
1591
|
+
ENTITY_TYPE: ClassVar[str] = "globalSettings"
|
|
1592
|
+
URN_PARTS: ClassVar[int] = 1
|
|
1593
|
+
|
|
1594
|
+
def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
|
|
1595
|
+
if _allow_coercion:
|
|
1596
|
+
# Field coercion logic (if any is required).
|
|
1597
|
+
id = UrnEncoder.encode_string(id)
|
|
1598
|
+
|
|
1599
|
+
# Validation logic.
|
|
1600
|
+
if not id:
|
|
1601
|
+
raise InvalidUrnError("GlobalSettingsUrn id cannot be empty")
|
|
1602
|
+
if UrnEncoder.contains_reserved_char(id):
|
|
1603
|
+
raise InvalidUrnError(f'GlobalSettingsUrn id contains reserved characters')
|
|
1604
|
+
|
|
1605
|
+
super().__init__(self.ENTITY_TYPE, [id])
|
|
1606
|
+
|
|
1607
|
+
@classmethod
|
|
1608
|
+
def _parse_ids(cls, entity_ids: List[str]) -> "GlobalSettingsUrn":
|
|
1609
|
+
if len(entity_ids) != cls.URN_PARTS:
|
|
1610
|
+
raise InvalidUrnError(f"GlobalSettingsUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
|
|
1611
|
+
return cls(id=entity_ids[0], _allow_coercion=False)
|
|
1612
|
+
|
|
1613
|
+
@classmethod
|
|
1614
|
+
def underlying_key_aspect_type(cls) -> Type["GlobalSettingsKeyClass"]:
|
|
1615
|
+
from datahub.metadata.schema_classes import GlobalSettingsKeyClass
|
|
1616
|
+
|
|
1617
|
+
return GlobalSettingsKeyClass
|
|
1618
|
+
|
|
1619
|
+
def to_key_aspect(self) -> "GlobalSettingsKeyClass":
|
|
1620
|
+
from datahub.metadata.schema_classes import GlobalSettingsKeyClass
|
|
1621
|
+
|
|
1622
|
+
return GlobalSettingsKeyClass(id=self.id)
|
|
1623
|
+
|
|
1624
|
+
@classmethod
|
|
1625
|
+
def from_key_aspect(cls, key_aspect: "GlobalSettingsKeyClass") -> "GlobalSettingsUrn":
|
|
1626
|
+
return cls(id=key_aspect.id)
|
|
1627
|
+
|
|
1628
|
+
@property
|
|
1629
|
+
def id(self) -> str:
|
|
1630
|
+
return self.entity_ids[0]
|
|
1631
|
+
|
|
1119
1632
|
if TYPE_CHECKING:
|
|
1120
1633
|
from datahub.metadata.schema_classes import MLFeatureTableKeyClass
|
|
1121
1634
|
|
|
@@ -1170,6 +1683,51 @@ class MlFeatureTableUrn(_SpecificUrn):
|
|
|
1170
1683
|
def name(self) -> str:
|
|
1171
1684
|
return self.entity_ids[1]
|
|
1172
1685
|
|
|
1686
|
+
if TYPE_CHECKING:
|
|
1687
|
+
from datahub.metadata.schema_classes import DataHubPersonaKeyClass
|
|
1688
|
+
|
|
1689
|
+
class DataHubPersonaUrn(_SpecificUrn):
|
|
1690
|
+
ENTITY_TYPE: ClassVar[str] = "dataHubPersona"
|
|
1691
|
+
URN_PARTS: ClassVar[int] = 1
|
|
1692
|
+
|
|
1693
|
+
def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
|
|
1694
|
+
if _allow_coercion:
|
|
1695
|
+
# Field coercion logic (if any is required).
|
|
1696
|
+
id = UrnEncoder.encode_string(id)
|
|
1697
|
+
|
|
1698
|
+
# Validation logic.
|
|
1699
|
+
if not id:
|
|
1700
|
+
raise InvalidUrnError("DataHubPersonaUrn id cannot be empty")
|
|
1701
|
+
if UrnEncoder.contains_reserved_char(id):
|
|
1702
|
+
raise InvalidUrnError(f'DataHubPersonaUrn id contains reserved characters')
|
|
1703
|
+
|
|
1704
|
+
super().__init__(self.ENTITY_TYPE, [id])
|
|
1705
|
+
|
|
1706
|
+
@classmethod
|
|
1707
|
+
def _parse_ids(cls, entity_ids: List[str]) -> "DataHubPersonaUrn":
|
|
1708
|
+
if len(entity_ids) != cls.URN_PARTS:
|
|
1709
|
+
raise InvalidUrnError(f"DataHubPersonaUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
|
|
1710
|
+
return cls(id=entity_ids[0], _allow_coercion=False)
|
|
1711
|
+
|
|
1712
|
+
@classmethod
|
|
1713
|
+
def underlying_key_aspect_type(cls) -> Type["DataHubPersonaKeyClass"]:
|
|
1714
|
+
from datahub.metadata.schema_classes import DataHubPersonaKeyClass
|
|
1715
|
+
|
|
1716
|
+
return DataHubPersonaKeyClass
|
|
1717
|
+
|
|
1718
|
+
def to_key_aspect(self) -> "DataHubPersonaKeyClass":
|
|
1719
|
+
from datahub.metadata.schema_classes import DataHubPersonaKeyClass
|
|
1720
|
+
|
|
1721
|
+
return DataHubPersonaKeyClass(id=self.id)
|
|
1722
|
+
|
|
1723
|
+
@classmethod
|
|
1724
|
+
def from_key_aspect(cls, key_aspect: "DataHubPersonaKeyClass") -> "DataHubPersonaUrn":
|
|
1725
|
+
return cls(id=key_aspect.id)
|
|
1726
|
+
|
|
1727
|
+
@property
|
|
1728
|
+
def id(self) -> str:
|
|
1729
|
+
return self.entity_ids[0]
|
|
1730
|
+
|
|
1173
1731
|
if TYPE_CHECKING:
|
|
1174
1732
|
from datahub.metadata.schema_classes import TagKeyClass
|
|
1175
1733
|
|
|
@@ -1675,6 +2233,51 @@ class MlPrimaryKeyUrn(_SpecificUrn):
|
|
|
1675
2233
|
def name(self) -> str:
|
|
1676
2234
|
return self.entity_ids[1]
|
|
1677
2235
|
|
|
2236
|
+
if TYPE_CHECKING:
|
|
2237
|
+
from datahub.metadata.schema_classes import DataHubAccessTokenKeyClass
|
|
2238
|
+
|
|
2239
|
+
class DataHubAccessTokenUrn(_SpecificUrn):
|
|
2240
|
+
ENTITY_TYPE: ClassVar[str] = "dataHubAccessToken"
|
|
2241
|
+
URN_PARTS: ClassVar[int] = 1
|
|
2242
|
+
|
|
2243
|
+
def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
|
|
2244
|
+
if _allow_coercion:
|
|
2245
|
+
# Field coercion logic (if any is required).
|
|
2246
|
+
id = UrnEncoder.encode_string(id)
|
|
2247
|
+
|
|
2248
|
+
# Validation logic.
|
|
2249
|
+
if not id:
|
|
2250
|
+
raise InvalidUrnError("DataHubAccessTokenUrn id cannot be empty")
|
|
2251
|
+
if UrnEncoder.contains_reserved_char(id):
|
|
2252
|
+
raise InvalidUrnError(f'DataHubAccessTokenUrn id contains reserved characters')
|
|
2253
|
+
|
|
2254
|
+
super().__init__(self.ENTITY_TYPE, [id])
|
|
2255
|
+
|
|
2256
|
+
@classmethod
|
|
2257
|
+
def _parse_ids(cls, entity_ids: List[str]) -> "DataHubAccessTokenUrn":
|
|
2258
|
+
if len(entity_ids) != cls.URN_PARTS:
|
|
2259
|
+
raise InvalidUrnError(f"DataHubAccessTokenUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
|
|
2260
|
+
return cls(id=entity_ids[0], _allow_coercion=False)
|
|
2261
|
+
|
|
2262
|
+
@classmethod
|
|
2263
|
+
def underlying_key_aspect_type(cls) -> Type["DataHubAccessTokenKeyClass"]:
|
|
2264
|
+
from datahub.metadata.schema_classes import DataHubAccessTokenKeyClass
|
|
2265
|
+
|
|
2266
|
+
return DataHubAccessTokenKeyClass
|
|
2267
|
+
|
|
2268
|
+
def to_key_aspect(self) -> "DataHubAccessTokenKeyClass":
|
|
2269
|
+
from datahub.metadata.schema_classes import DataHubAccessTokenKeyClass
|
|
2270
|
+
|
|
2271
|
+
return DataHubAccessTokenKeyClass(id=self.id)
|
|
2272
|
+
|
|
2273
|
+
@classmethod
|
|
2274
|
+
def from_key_aspect(cls, key_aspect: "DataHubAccessTokenKeyClass") -> "DataHubAccessTokenUrn":
|
|
2275
|
+
return cls(id=key_aspect.id)
|
|
2276
|
+
|
|
2277
|
+
@property
|
|
2278
|
+
def id(self) -> str:
|
|
2279
|
+
return self.entity_ids[0]
|
|
2280
|
+
|
|
1678
2281
|
if TYPE_CHECKING:
|
|
1679
2282
|
from datahub.metadata.schema_classes import DataPlatformKeyClass
|
|
1680
2283
|
|
|
@@ -2017,6 +2620,96 @@ class MonitorUrn(_SpecificUrn):
|
|
|
2017
2620
|
def id(self) -> str:
|
|
2018
2621
|
return self.entity_ids[1]
|
|
2019
2622
|
|
|
2623
|
+
if TYPE_CHECKING:
|
|
2624
|
+
from datahub.metadata.schema_classes import InviteTokenKeyClass
|
|
2625
|
+
|
|
2626
|
+
class InviteTokenUrn(_SpecificUrn):
|
|
2627
|
+
ENTITY_TYPE: ClassVar[str] = "inviteToken"
|
|
2628
|
+
URN_PARTS: ClassVar[int] = 1
|
|
2629
|
+
|
|
2630
|
+
def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
|
|
2631
|
+
if _allow_coercion:
|
|
2632
|
+
# Field coercion logic (if any is required).
|
|
2633
|
+
id = UrnEncoder.encode_string(id)
|
|
2634
|
+
|
|
2635
|
+
# Validation logic.
|
|
2636
|
+
if not id:
|
|
2637
|
+
raise InvalidUrnError("InviteTokenUrn id cannot be empty")
|
|
2638
|
+
if UrnEncoder.contains_reserved_char(id):
|
|
2639
|
+
raise InvalidUrnError(f'InviteTokenUrn id contains reserved characters')
|
|
2640
|
+
|
|
2641
|
+
super().__init__(self.ENTITY_TYPE, [id])
|
|
2642
|
+
|
|
2643
|
+
@classmethod
|
|
2644
|
+
def _parse_ids(cls, entity_ids: List[str]) -> "InviteTokenUrn":
|
|
2645
|
+
if len(entity_ids) != cls.URN_PARTS:
|
|
2646
|
+
raise InvalidUrnError(f"InviteTokenUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
|
|
2647
|
+
return cls(id=entity_ids[0], _allow_coercion=False)
|
|
2648
|
+
|
|
2649
|
+
@classmethod
|
|
2650
|
+
def underlying_key_aspect_type(cls) -> Type["InviteTokenKeyClass"]:
|
|
2651
|
+
from datahub.metadata.schema_classes import InviteTokenKeyClass
|
|
2652
|
+
|
|
2653
|
+
return InviteTokenKeyClass
|
|
2654
|
+
|
|
2655
|
+
def to_key_aspect(self) -> "InviteTokenKeyClass":
|
|
2656
|
+
from datahub.metadata.schema_classes import InviteTokenKeyClass
|
|
2657
|
+
|
|
2658
|
+
return InviteTokenKeyClass(id=self.id)
|
|
2659
|
+
|
|
2660
|
+
@classmethod
|
|
2661
|
+
def from_key_aspect(cls, key_aspect: "InviteTokenKeyClass") -> "InviteTokenUrn":
|
|
2662
|
+
return cls(id=key_aspect.id)
|
|
2663
|
+
|
|
2664
|
+
@property
|
|
2665
|
+
def id(self) -> str:
|
|
2666
|
+
return self.entity_ids[0]
|
|
2667
|
+
|
|
2668
|
+
if TYPE_CHECKING:
|
|
2669
|
+
from datahub.metadata.schema_classes import DataHubPolicyKeyClass
|
|
2670
|
+
|
|
2671
|
+
class DataHubPolicyUrn(_SpecificUrn):
|
|
2672
|
+
ENTITY_TYPE: ClassVar[str] = "dataHubPolicy"
|
|
2673
|
+
URN_PARTS: ClassVar[int] = 1
|
|
2674
|
+
|
|
2675
|
+
def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
|
|
2676
|
+
if _allow_coercion:
|
|
2677
|
+
# Field coercion logic (if any is required).
|
|
2678
|
+
id = UrnEncoder.encode_string(id)
|
|
2679
|
+
|
|
2680
|
+
# Validation logic.
|
|
2681
|
+
if not id:
|
|
2682
|
+
raise InvalidUrnError("DataHubPolicyUrn id cannot be empty")
|
|
2683
|
+
if UrnEncoder.contains_reserved_char(id):
|
|
2684
|
+
raise InvalidUrnError(f'DataHubPolicyUrn id contains reserved characters')
|
|
2685
|
+
|
|
2686
|
+
super().__init__(self.ENTITY_TYPE, [id])
|
|
2687
|
+
|
|
2688
|
+
@classmethod
|
|
2689
|
+
def _parse_ids(cls, entity_ids: List[str]) -> "DataHubPolicyUrn":
|
|
2690
|
+
if len(entity_ids) != cls.URN_PARTS:
|
|
2691
|
+
raise InvalidUrnError(f"DataHubPolicyUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
|
|
2692
|
+
return cls(id=entity_ids[0], _allow_coercion=False)
|
|
2693
|
+
|
|
2694
|
+
@classmethod
|
|
2695
|
+
def underlying_key_aspect_type(cls) -> Type["DataHubPolicyKeyClass"]:
|
|
2696
|
+
from datahub.metadata.schema_classes import DataHubPolicyKeyClass
|
|
2697
|
+
|
|
2698
|
+
return DataHubPolicyKeyClass
|
|
2699
|
+
|
|
2700
|
+
def to_key_aspect(self) -> "DataHubPolicyKeyClass":
|
|
2701
|
+
from datahub.metadata.schema_classes import DataHubPolicyKeyClass
|
|
2702
|
+
|
|
2703
|
+
return DataHubPolicyKeyClass(id=self.id)
|
|
2704
|
+
|
|
2705
|
+
@classmethod
|
|
2706
|
+
def from_key_aspect(cls, key_aspect: "DataHubPolicyKeyClass") -> "DataHubPolicyUrn":
|
|
2707
|
+
return cls(id=key_aspect.id)
|
|
2708
|
+
|
|
2709
|
+
@property
|
|
2710
|
+
def id(self) -> str:
|
|
2711
|
+
return self.entity_ids[0]
|
|
2712
|
+
|
|
2020
2713
|
if TYPE_CHECKING:
|
|
2021
2714
|
from datahub.metadata.schema_classes import DomainKeyClass
|
|
2022
2715
|
|
|
@@ -2067,6 +2760,96 @@ class DomainUrn(_SpecificUrn):
|
|
|
2067
2760
|
def id(self) -> str:
|
|
2068
2761
|
return self.entity_ids[0]
|
|
2069
2762
|
|
|
2763
|
+
if TYPE_CHECKING:
|
|
2764
|
+
from datahub.metadata.schema_classes import DataHubActionKeyClass
|
|
2765
|
+
|
|
2766
|
+
class DataHubActionUrn(_SpecificUrn):
|
|
2767
|
+
ENTITY_TYPE: ClassVar[str] = "dataHubAction"
|
|
2768
|
+
URN_PARTS: ClassVar[int] = 1
|
|
2769
|
+
|
|
2770
|
+
def __init__(self, id: str, *, _allow_coercion: bool = True) -> None:
|
|
2771
|
+
if _allow_coercion:
|
|
2772
|
+
# Field coercion logic (if any is required).
|
|
2773
|
+
id = UrnEncoder.encode_string(id)
|
|
2774
|
+
|
|
2775
|
+
# Validation logic.
|
|
2776
|
+
if not id:
|
|
2777
|
+
raise InvalidUrnError("DataHubActionUrn id cannot be empty")
|
|
2778
|
+
if UrnEncoder.contains_reserved_char(id):
|
|
2779
|
+
raise InvalidUrnError(f'DataHubActionUrn id contains reserved characters')
|
|
2780
|
+
|
|
2781
|
+
super().__init__(self.ENTITY_TYPE, [id])
|
|
2782
|
+
|
|
2783
|
+
@classmethod
|
|
2784
|
+
def _parse_ids(cls, entity_ids: List[str]) -> "DataHubActionUrn":
|
|
2785
|
+
if len(entity_ids) != cls.URN_PARTS:
|
|
2786
|
+
raise InvalidUrnError(f"DataHubActionUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
|
|
2787
|
+
return cls(id=entity_ids[0], _allow_coercion=False)
|
|
2788
|
+
|
|
2789
|
+
@classmethod
|
|
2790
|
+
def underlying_key_aspect_type(cls) -> Type["DataHubActionKeyClass"]:
|
|
2791
|
+
from datahub.metadata.schema_classes import DataHubActionKeyClass
|
|
2792
|
+
|
|
2793
|
+
return DataHubActionKeyClass
|
|
2794
|
+
|
|
2795
|
+
def to_key_aspect(self) -> "DataHubActionKeyClass":
|
|
2796
|
+
from datahub.metadata.schema_classes import DataHubActionKeyClass
|
|
2797
|
+
|
|
2798
|
+
return DataHubActionKeyClass(id=self.id)
|
|
2799
|
+
|
|
2800
|
+
@classmethod
|
|
2801
|
+
def from_key_aspect(cls, key_aspect: "DataHubActionKeyClass") -> "DataHubActionUrn":
|
|
2802
|
+
return cls(id=key_aspect.id)
|
|
2803
|
+
|
|
2804
|
+
@property
|
|
2805
|
+
def id(self) -> str:
|
|
2806
|
+
return self.entity_ids[0]
|
|
2807
|
+
|
|
2808
|
+
if TYPE_CHECKING:
|
|
2809
|
+
from datahub.metadata.schema_classes import TelemetryKeyClass
|
|
2810
|
+
|
|
2811
|
+
class TelemetryUrn(_SpecificUrn):
|
|
2812
|
+
ENTITY_TYPE: ClassVar[str] = "telemetry"
|
|
2813
|
+
URN_PARTS: ClassVar[int] = 1
|
|
2814
|
+
|
|
2815
|
+
def __init__(self, name: str, *, _allow_coercion: bool = True) -> None:
|
|
2816
|
+
if _allow_coercion:
|
|
2817
|
+
# Field coercion logic (if any is required).
|
|
2818
|
+
name = UrnEncoder.encode_string(name)
|
|
2819
|
+
|
|
2820
|
+
# Validation logic.
|
|
2821
|
+
if not name:
|
|
2822
|
+
raise InvalidUrnError("TelemetryUrn name cannot be empty")
|
|
2823
|
+
if UrnEncoder.contains_reserved_char(name):
|
|
2824
|
+
raise InvalidUrnError(f'TelemetryUrn name contains reserved characters')
|
|
2825
|
+
|
|
2826
|
+
super().__init__(self.ENTITY_TYPE, [name])
|
|
2827
|
+
|
|
2828
|
+
@classmethod
|
|
2829
|
+
def _parse_ids(cls, entity_ids: List[str]) -> "TelemetryUrn":
|
|
2830
|
+
if len(entity_ids) != cls.URN_PARTS:
|
|
2831
|
+
raise InvalidUrnError(f"TelemetryUrn should have {cls.URN_PARTS} parts, got {len(entity_ids)}: {entity_ids}")
|
|
2832
|
+
return cls(name=entity_ids[0], _allow_coercion=False)
|
|
2833
|
+
|
|
2834
|
+
@classmethod
|
|
2835
|
+
def underlying_key_aspect_type(cls) -> Type["TelemetryKeyClass"]:
|
|
2836
|
+
from datahub.metadata.schema_classes import TelemetryKeyClass
|
|
2837
|
+
|
|
2838
|
+
return TelemetryKeyClass
|
|
2839
|
+
|
|
2840
|
+
def to_key_aspect(self) -> "TelemetryKeyClass":
|
|
2841
|
+
from datahub.metadata.schema_classes import TelemetryKeyClass
|
|
2842
|
+
|
|
2843
|
+
return TelemetryKeyClass(name=self.name)
|
|
2844
|
+
|
|
2845
|
+
@classmethod
|
|
2846
|
+
def from_key_aspect(cls, key_aspect: "TelemetryKeyClass") -> "TelemetryUrn":
|
|
2847
|
+
return cls(name=key_aspect.name)
|
|
2848
|
+
|
|
2849
|
+
@property
|
|
2850
|
+
def name(self) -> str:
|
|
2851
|
+
return self.entity_ids[0]
|
|
2852
|
+
|
|
2070
2853
|
if TYPE_CHECKING:
|
|
2071
2854
|
from datahub.metadata.schema_classes import MLModelKeyClass
|
|
2072
2855
|
|