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