acryl-datahub-cloud 0.3.10rc4__py3-none-any.whl → 0.3.16.1rc0__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.

Files changed (243) hide show
  1. acryl_datahub_cloud/_codegen_config.json +1 -1
  2. acryl_datahub_cloud/acryl_cs_issues/acryl_customer.py +1 -1
  3. acryl_datahub_cloud/acryl_cs_issues/models.py +5 -3
  4. acryl_datahub_cloud/action_request/action_request_owner_source.py +37 -8
  5. acryl_datahub_cloud/datahub_forms_notifications/__init__.py +0 -0
  6. acryl_datahub_cloud/datahub_forms_notifications/forms_notifications_source.py +569 -0
  7. acryl_datahub_cloud/datahub_forms_notifications/get_feature_flag.gql +7 -0
  8. acryl_datahub_cloud/datahub_forms_notifications/get_search_results_total.gql +14 -0
  9. acryl_datahub_cloud/datahub_forms_notifications/query.py +17 -0
  10. acryl_datahub_cloud/datahub_forms_notifications/scroll_forms_for_notification.gql +29 -0
  11. acryl_datahub_cloud/datahub_forms_notifications/send_form_notification_request.gql +5 -0
  12. acryl_datahub_cloud/datahub_reporting/datahub_dataset.py +39 -19
  13. acryl_datahub_cloud/datahub_reporting/datahub_form_reporting.py +60 -25
  14. acryl_datahub_cloud/datahub_reporting/extract_graph.py +9 -3
  15. acryl_datahub_cloud/datahub_reporting/extract_sql.py +248 -52
  16. acryl_datahub_cloud/datahub_reporting/forms.py +1 -1
  17. acryl_datahub_cloud/datahub_reporting/forms_config.py +3 -2
  18. acryl_datahub_cloud/datahub_restore/source.py +3 -2
  19. acryl_datahub_cloud/datahub_usage_reporting/excluded.py +94 -0
  20. acryl_datahub_cloud/datahub_usage_reporting/query_builder.py +48 -8
  21. acryl_datahub_cloud/datahub_usage_reporting/usage_feature_reporter.py +532 -109
  22. acryl_datahub_cloud/elasticsearch/graph_service.py +76 -14
  23. acryl_datahub_cloud/graphql_utils.py +64 -0
  24. acryl_datahub_cloud/lineage_features/source.py +555 -49
  25. acryl_datahub_cloud/metadata/_urns/urn_defs.py +2390 -1938
  26. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/actionworkflow/__init__.py +53 -0
  27. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/anomaly/__init__.py +2 -0
  28. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/application/__init__.py +19 -0
  29. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/assertion/__init__.py +6 -2
  30. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/common/__init__.py +6 -0
  31. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/conversation/__init__.py +29 -0
  32. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/event/notification/settings/__init__.py +2 -0
  33. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/execution/__init__.py +2 -0
  34. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/file/__init__.py +19 -0
  35. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/form/__init__.py +8 -0
  36. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/identity/__init__.py +8 -0
  37. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/knowledge/__init__.py +33 -0
  38. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/logical/__init__.py +15 -0
  39. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/metadata/key/__init__.py +14 -0
  40. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/metadata/search/features/__init__.py +2 -0
  41. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/module/__init__.py +31 -0
  42. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/monitor/__init__.py +6 -0
  43. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/notification/__init__.py +19 -0
  44. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/platform/event/v1/__init__.py +4 -0
  45. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/role/__init__.py +2 -0
  46. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/settings/asset/__init__.py +19 -0
  47. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/settings/global/__init__.py +28 -0
  48. acryl_datahub_cloud/metadata/com/linkedin/pegasus2avro/template/__init__.py +31 -0
  49. acryl_datahub_cloud/metadata/schema.avsc +27843 -23200
  50. acryl_datahub_cloud/metadata/schema_classes.py +29901 -24310
  51. acryl_datahub_cloud/metadata/schemas/ActionRequestInfo.avsc +235 -2
  52. acryl_datahub_cloud/metadata/schemas/ActionWorkflowInfo.avsc +683 -0
  53. acryl_datahub_cloud/metadata/schemas/ActionWorkflowKey.avsc +21 -0
  54. acryl_datahub_cloud/metadata/schemas/Actors.avsc +38 -1
  55. acryl_datahub_cloud/metadata/schemas/ApplicationKey.avsc +31 -0
  56. acryl_datahub_cloud/metadata/schemas/ApplicationProperties.avsc +75 -0
  57. acryl_datahub_cloud/metadata/schemas/Applications.avsc +38 -0
  58. acryl_datahub_cloud/metadata/schemas/AssertionAnalyticsRunEvent.avsc +375 -212
  59. acryl_datahub_cloud/metadata/schemas/AssertionInfo.avsc +147 -20
  60. acryl_datahub_cloud/metadata/schemas/AssertionKey.avsc +1 -1
  61. acryl_datahub_cloud/metadata/schemas/AssertionRunEvent.avsc +191 -21
  62. acryl_datahub_cloud/metadata/schemas/{AssertionSummary.avsc → AssertionRunSummary.avsc} +15 -2
  63. acryl_datahub_cloud/metadata/schemas/AssertionsSummary.avsc +54 -0
  64. acryl_datahub_cloud/metadata/schemas/AssetSettings.avsc +63 -0
  65. acryl_datahub_cloud/metadata/schemas/BusinessAttributeInfo.avsc +7 -3
  66. acryl_datahub_cloud/metadata/schemas/ChartInfo.avsc +20 -6
  67. acryl_datahub_cloud/metadata/schemas/ChartKey.avsc +1 -0
  68. acryl_datahub_cloud/metadata/schemas/ConstraintInfo.avsc +12 -1
  69. acryl_datahub_cloud/metadata/schemas/ContainerKey.avsc +1 -0
  70. acryl_datahub_cloud/metadata/schemas/ContainerProperties.avsc +16 -5
  71. acryl_datahub_cloud/metadata/schemas/CorpGroupEditableInfo.avsc +2 -1
  72. acryl_datahub_cloud/metadata/schemas/CorpGroupInfo.avsc +7 -3
  73. acryl_datahub_cloud/metadata/schemas/CorpGroupKey.avsc +2 -1
  74. acryl_datahub_cloud/metadata/schemas/CorpGroupSettings.avsc +127 -2
  75. acryl_datahub_cloud/metadata/schemas/CorpUserEditableInfo.avsc +1 -1
  76. acryl_datahub_cloud/metadata/schemas/CorpUserInfo.avsc +18 -2
  77. acryl_datahub_cloud/metadata/schemas/CorpUserInvitationStatus.avsc +106 -0
  78. acryl_datahub_cloud/metadata/schemas/CorpUserKey.avsc +4 -1
  79. acryl_datahub_cloud/metadata/schemas/CorpUserSettings.avsc +304 -2
  80. acryl_datahub_cloud/metadata/schemas/CorpUserUsageFeatures.avsc +86 -0
  81. acryl_datahub_cloud/metadata/schemas/DashboardInfo.avsc +11 -5
  82. acryl_datahub_cloud/metadata/schemas/DashboardKey.avsc +1 -0
  83. acryl_datahub_cloud/metadata/schemas/DataContractKey.avsc +2 -1
  84. acryl_datahub_cloud/metadata/schemas/DataFlowInfo.avsc +15 -5
  85. acryl_datahub_cloud/metadata/schemas/DataFlowKey.avsc +1 -0
  86. acryl_datahub_cloud/metadata/schemas/DataHubAiConversationInfo.avsc +256 -0
  87. acryl_datahub_cloud/metadata/schemas/DataHubAiConversationKey.avsc +22 -0
  88. acryl_datahub_cloud/metadata/schemas/DataHubFileInfo.avsc +234 -0
  89. acryl_datahub_cloud/metadata/schemas/DataHubFileKey.avsc +22 -0
  90. acryl_datahub_cloud/metadata/schemas/DataHubIngestionSourceKey.avsc +2 -1
  91. acryl_datahub_cloud/metadata/schemas/DataHubOpenAPISchemaKey.avsc +22 -0
  92. acryl_datahub_cloud/metadata/schemas/DataHubPageModuleKey.avsc +21 -0
  93. acryl_datahub_cloud/metadata/schemas/DataHubPageModuleProperties.avsc +308 -0
  94. acryl_datahub_cloud/metadata/schemas/DataHubPageTemplateKey.avsc +21 -0
  95. acryl_datahub_cloud/metadata/schemas/DataHubPageTemplateProperties.avsc +251 -0
  96. acryl_datahub_cloud/metadata/schemas/DataHubPolicyInfo.avsc +12 -1
  97. acryl_datahub_cloud/metadata/schemas/DataJobInfo.avsc +13 -4
  98. acryl_datahub_cloud/metadata/schemas/DataJobInputOutput.avsc +8 -0
  99. acryl_datahub_cloud/metadata/schemas/DataJobKey.avsc +1 -0
  100. acryl_datahub_cloud/metadata/schemas/DataPlatformInfo.avsc +3 -1
  101. acryl_datahub_cloud/metadata/schemas/DataPlatformInstanceProperties.avsc +5 -2
  102. acryl_datahub_cloud/metadata/schemas/DataProcessKey.avsc +4 -0
  103. acryl_datahub_cloud/metadata/schemas/DataProductKey.avsc +2 -0
  104. acryl_datahub_cloud/metadata/schemas/DataProductProperties.avsc +6 -3
  105. acryl_datahub_cloud/metadata/schemas/DataTransformLogic.avsc +4 -2
  106. acryl_datahub_cloud/metadata/schemas/DataTypeInfo.avsc +5 -0
  107. acryl_datahub_cloud/metadata/schemas/DatasetKey.avsc +10 -2
  108. acryl_datahub_cloud/metadata/schemas/DatasetProperties.avsc +12 -5
  109. acryl_datahub_cloud/metadata/schemas/DatasetUsageStatistics.avsc +8 -0
  110. acryl_datahub_cloud/metadata/schemas/DocumentInfo.avsc +407 -0
  111. acryl_datahub_cloud/metadata/schemas/DocumentKey.avsc +35 -0
  112. acryl_datahub_cloud/metadata/schemas/DocumentSettings.avsc +79 -0
  113. acryl_datahub_cloud/metadata/schemas/DomainKey.avsc +2 -0
  114. acryl_datahub_cloud/metadata/schemas/DomainProperties.avsc +7 -3
  115. acryl_datahub_cloud/metadata/schemas/EditableContainerProperties.avsc +2 -1
  116. acryl_datahub_cloud/metadata/schemas/EditableDashboardProperties.avsc +2 -1
  117. acryl_datahub_cloud/metadata/schemas/EditableDataFlowProperties.avsc +2 -1
  118. acryl_datahub_cloud/metadata/schemas/EditableDataJobProperties.avsc +2 -1
  119. acryl_datahub_cloud/metadata/schemas/EditableDatasetProperties.avsc +2 -1
  120. acryl_datahub_cloud/metadata/schemas/EditableERModelRelationshipProperties.avsc +2 -1
  121. acryl_datahub_cloud/metadata/schemas/EditableMLFeatureProperties.avsc +2 -1
  122. acryl_datahub_cloud/metadata/schemas/EditableMLFeatureTableProperties.avsc +2 -1
  123. acryl_datahub_cloud/metadata/schemas/EditableMLModelGroupProperties.avsc +2 -1
  124. acryl_datahub_cloud/metadata/schemas/EditableMLModelProperties.avsc +2 -1
  125. acryl_datahub_cloud/metadata/schemas/EditableNotebookProperties.avsc +2 -1
  126. acryl_datahub_cloud/metadata/schemas/EditableSchemaMetadata.avsc +4 -2
  127. acryl_datahub_cloud/metadata/schemas/EntityTypeInfo.avsc +5 -0
  128. acryl_datahub_cloud/metadata/schemas/ExecutionRequestArtifactsLocation.avsc +16 -0
  129. acryl_datahub_cloud/metadata/schemas/ExecutionRequestKey.avsc +2 -1
  130. acryl_datahub_cloud/metadata/schemas/FormAssignmentStatus.avsc +36 -0
  131. acryl_datahub_cloud/metadata/schemas/FormInfo.avsc +6 -0
  132. acryl_datahub_cloud/metadata/schemas/FormKey.avsc +3 -1
  133. acryl_datahub_cloud/metadata/schemas/FormNotifications.avsc +69 -0
  134. acryl_datahub_cloud/metadata/schemas/FormSettings.avsc +30 -0
  135. acryl_datahub_cloud/metadata/schemas/GlobalSettingsInfo.avsc +416 -0
  136. acryl_datahub_cloud/metadata/schemas/GlobalTags.avsc +2 -1
  137. acryl_datahub_cloud/metadata/schemas/GlossaryNodeInfo.avsc +3 -1
  138. acryl_datahub_cloud/metadata/schemas/GlossaryNodeKey.avsc +1 -0
  139. acryl_datahub_cloud/metadata/schemas/GlossaryTermInfo.avsc +3 -1
  140. acryl_datahub_cloud/metadata/schemas/GlossaryTermKey.avsc +2 -0
  141. acryl_datahub_cloud/metadata/schemas/IcebergWarehouseInfo.avsc +4 -0
  142. acryl_datahub_cloud/metadata/schemas/IncidentActivityEvent.avsc +3 -3
  143. acryl_datahub_cloud/metadata/schemas/IncidentInfo.avsc +3 -3
  144. acryl_datahub_cloud/metadata/schemas/InferredMetadata.avsc +71 -1
  145. acryl_datahub_cloud/metadata/schemas/InputFields.avsc +2 -1
  146. acryl_datahub_cloud/metadata/schemas/InviteToken.avsc +26 -0
  147. acryl_datahub_cloud/metadata/schemas/LineageFeatures.avsc +67 -42
  148. acryl_datahub_cloud/metadata/schemas/LogicalParent.avsc +145 -0
  149. acryl_datahub_cloud/metadata/schemas/MLFeatureKey.avsc +4 -1
  150. acryl_datahub_cloud/metadata/schemas/MLFeatureTableKey.avsc +4 -1
  151. acryl_datahub_cloud/metadata/schemas/MLModelDeploymentKey.avsc +7 -1
  152. acryl_datahub_cloud/metadata/schemas/MLModelDeploymentProperties.avsc +3 -0
  153. acryl_datahub_cloud/metadata/schemas/MLModelGroupKey.avsc +9 -1
  154. acryl_datahub_cloud/metadata/schemas/MLModelKey.avsc +9 -1
  155. acryl_datahub_cloud/metadata/schemas/MLModelProperties.avsc +4 -2
  156. acryl_datahub_cloud/metadata/schemas/MLPrimaryKeyKey.avsc +4 -1
  157. acryl_datahub_cloud/metadata/schemas/MetadataChangeEvent.avsc +424 -97
  158. acryl_datahub_cloud/metadata/schemas/MetadataChangeLog.avsc +65 -44
  159. acryl_datahub_cloud/metadata/schemas/MetadataChangeProposal.avsc +64 -0
  160. acryl_datahub_cloud/metadata/schemas/MonitorAnomalyEvent.avsc +84 -29
  161. acryl_datahub_cloud/metadata/schemas/MonitorInfo.avsc +221 -23
  162. acryl_datahub_cloud/metadata/schemas/MonitorKey.avsc +9 -1
  163. acryl_datahub_cloud/metadata/schemas/MonitorSuiteInfo.avsc +128 -3
  164. acryl_datahub_cloud/metadata/schemas/NotebookInfo.avsc +5 -2
  165. acryl_datahub_cloud/metadata/schemas/NotebookKey.avsc +1 -0
  166. acryl_datahub_cloud/metadata/schemas/NotificationRequest.avsc +91 -4
  167. acryl_datahub_cloud/metadata/schemas/Operation.avsc +17 -0
  168. acryl_datahub_cloud/metadata/schemas/Ownership.avsc +71 -1
  169. acryl_datahub_cloud/metadata/schemas/QueryProperties.avsc +4 -2
  170. acryl_datahub_cloud/metadata/schemas/QuerySubjects.avsc +2 -13
  171. acryl_datahub_cloud/metadata/schemas/RelationshipChangeEvent.avsc +215 -0
  172. acryl_datahub_cloud/metadata/schemas/RoleProperties.avsc +3 -1
  173. acryl_datahub_cloud/metadata/schemas/SchemaFieldInfo.avsc +3 -1
  174. acryl_datahub_cloud/metadata/schemas/SchemaFieldKey.avsc +3 -0
  175. acryl_datahub_cloud/metadata/schemas/SchemaMetadata.avsc +2 -1
  176. acryl_datahub_cloud/metadata/schemas/SemanticContent.avsc +123 -0
  177. acryl_datahub_cloud/metadata/schemas/StructuredProperties.avsc +69 -0
  178. acryl_datahub_cloud/metadata/schemas/StructuredPropertyDefinition.avsc +15 -4
  179. acryl_datahub_cloud/metadata/schemas/StructuredPropertySettings.avsc +9 -0
  180. acryl_datahub_cloud/metadata/schemas/SubscriptionInfo.avsc +136 -5
  181. acryl_datahub_cloud/metadata/schemas/SubscriptionKey.avsc +2 -1
  182. acryl_datahub_cloud/metadata/schemas/SystemMetadata.avsc +147 -0
  183. acryl_datahub_cloud/metadata/schemas/TagProperties.avsc +3 -1
  184. acryl_datahub_cloud/metadata/schemas/TestInfo.avsc +2 -1
  185. acryl_datahub_cloud/metadata/schemas/UpstreamLineage.avsc +9 -0
  186. acryl_datahub_cloud/metadata/schemas/UsageFeatures.avsc +10 -0
  187. acryl_datahub_cloud/metadata/schemas/__init__.py +3 -3
  188. acryl_datahub_cloud/notifications/__init__.py +0 -0
  189. acryl_datahub_cloud/notifications/notification_recipient_builder.py +399 -0
  190. acryl_datahub_cloud/sdk/__init__.py +69 -0
  191. acryl_datahub_cloud/sdk/assertion/__init__.py +58 -0
  192. acryl_datahub_cloud/sdk/assertion/assertion_base.py +779 -0
  193. acryl_datahub_cloud/sdk/assertion/column_metric_assertion.py +191 -0
  194. acryl_datahub_cloud/sdk/assertion/column_value_assertion.py +431 -0
  195. acryl_datahub_cloud/sdk/assertion/freshness_assertion.py +201 -0
  196. acryl_datahub_cloud/sdk/assertion/schema_assertion.py +268 -0
  197. acryl_datahub_cloud/sdk/assertion/smart_column_metric_assertion.py +212 -0
  198. acryl_datahub_cloud/sdk/assertion/smart_freshness_assertion.py +165 -0
  199. acryl_datahub_cloud/sdk/assertion/smart_sql_assertion.py +156 -0
  200. acryl_datahub_cloud/sdk/assertion/smart_volume_assertion.py +162 -0
  201. acryl_datahub_cloud/sdk/assertion/sql_assertion.py +273 -0
  202. acryl_datahub_cloud/sdk/assertion/types.py +20 -0
  203. acryl_datahub_cloud/sdk/assertion/volume_assertion.py +156 -0
  204. acryl_datahub_cloud/sdk/assertion_client/__init__.py +0 -0
  205. acryl_datahub_cloud/sdk/assertion_client/column_metric.py +545 -0
  206. acryl_datahub_cloud/sdk/assertion_client/column_value.py +617 -0
  207. acryl_datahub_cloud/sdk/assertion_client/freshness.py +371 -0
  208. acryl_datahub_cloud/sdk/assertion_client/helpers.py +166 -0
  209. acryl_datahub_cloud/sdk/assertion_client/schema.py +358 -0
  210. acryl_datahub_cloud/sdk/assertion_client/smart_column_metric.py +540 -0
  211. acryl_datahub_cloud/sdk/assertion_client/smart_freshness.py +373 -0
  212. acryl_datahub_cloud/sdk/assertion_client/smart_sql.py +411 -0
  213. acryl_datahub_cloud/sdk/assertion_client/smart_volume.py +380 -0
  214. acryl_datahub_cloud/sdk/assertion_client/sql.py +410 -0
  215. acryl_datahub_cloud/sdk/assertion_client/volume.py +446 -0
  216. acryl_datahub_cloud/sdk/assertion_input/__init__.py +0 -0
  217. acryl_datahub_cloud/sdk/assertion_input/assertion_input.py +1470 -0
  218. acryl_datahub_cloud/sdk/assertion_input/column_assertion_constants.py +114 -0
  219. acryl_datahub_cloud/sdk/assertion_input/column_assertion_utils.py +284 -0
  220. acryl_datahub_cloud/sdk/assertion_input/column_metric_assertion_input.py +759 -0
  221. acryl_datahub_cloud/sdk/assertion_input/column_metric_constants.py +109 -0
  222. acryl_datahub_cloud/sdk/assertion_input/column_value_assertion_input.py +810 -0
  223. acryl_datahub_cloud/sdk/assertion_input/freshness_assertion_input.py +305 -0
  224. acryl_datahub_cloud/sdk/assertion_input/schema_assertion_input.py +413 -0
  225. acryl_datahub_cloud/sdk/assertion_input/smart_column_metric_assertion_input.py +793 -0
  226. acryl_datahub_cloud/sdk/assertion_input/smart_freshness_assertion_input.py +218 -0
  227. acryl_datahub_cloud/sdk/assertion_input/smart_sql_assertion_input.py +181 -0
  228. acryl_datahub_cloud/sdk/assertion_input/smart_volume_assertion_input.py +189 -0
  229. acryl_datahub_cloud/sdk/assertion_input/sql_assertion_input.py +320 -0
  230. acryl_datahub_cloud/sdk/assertion_input/volume_assertion_input.py +635 -0
  231. acryl_datahub_cloud/sdk/assertions_client.py +1074 -0
  232. acryl_datahub_cloud/sdk/entities/__init__.py +0 -0
  233. acryl_datahub_cloud/sdk/entities/assertion.py +439 -0
  234. acryl_datahub_cloud/sdk/entities/monitor.py +291 -0
  235. acryl_datahub_cloud/sdk/entities/subscription.py +100 -0
  236. acryl_datahub_cloud/sdk/errors.py +34 -0
  237. acryl_datahub_cloud/sdk/resolver_client.py +42 -0
  238. acryl_datahub_cloud/sdk/subscription_client.py +737 -0
  239. {acryl_datahub_cloud-0.3.10rc4.dist-info → acryl_datahub_cloud-0.3.16.1rc0.dist-info}/METADATA +49 -43
  240. {acryl_datahub_cloud-0.3.10rc4.dist-info → acryl_datahub_cloud-0.3.16.1rc0.dist-info}/RECORD +243 -145
  241. {acryl_datahub_cloud-0.3.10rc4.dist-info → acryl_datahub_cloud-0.3.16.1rc0.dist-info}/WHEEL +1 -1
  242. {acryl_datahub_cloud-0.3.10rc4.dist-info → acryl_datahub_cloud-0.3.16.1rc0.dist-info}/entry_points.txt +1 -0
  243. {acryl_datahub_cloud-0.3.10rc4.dist-info → acryl_datahub_cloud-0.3.16.1rc0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,305 @@
1
+ from datetime import datetime
2
+ from enum import Enum
3
+ from typing import Optional, Union
4
+
5
+ from acryl_datahub_cloud.sdk.assertion_input.assertion_input import (
6
+ DEFAULT_DAILY_SCHEDULE,
7
+ HIGH_WATERMARK_ALLOWED_FIELD_TYPES,
8
+ LAST_MODIFIED_ALLOWED_FIELD_TYPES,
9
+ AssertionIncidentBehaviorInputTypes,
10
+ DetectionMechanismInputTypes,
11
+ FieldSpecType,
12
+ TimeWindowSizeInputTypes,
13
+ _AssertionInput,
14
+ _AuditLog,
15
+ _DataHubOperation,
16
+ _HasFreshnessFeatures,
17
+ _HighWatermarkColumn,
18
+ _InformationSchema,
19
+ _LastModifiedColumn,
20
+ _try_parse_and_validate_schema_classes_enum,
21
+ _try_parse_time_window_size,
22
+ )
23
+ from acryl_datahub_cloud.sdk.entities.assertion import (
24
+ AssertionInfoInputType,
25
+ TagsInputType,
26
+ )
27
+ from acryl_datahub_cloud.sdk.errors import (
28
+ SDKNotYetSupportedError,
29
+ SDKUsageError,
30
+ )
31
+ from datahub.metadata import schema_classes as models
32
+ from datahub.metadata.urns import AssertionUrn, CorpUserUrn, DatasetUrn
33
+ from datahub.sdk.entity_client import EntityClient
34
+
35
+
36
+ class FreshnessAssertionScheduleCheckType(str, Enum):
37
+ FIXED_INTERVAL = "FIXED_INTERVAL"
38
+ SINCE_THE_LAST_CHECK = "SINCE_THE_LAST_CHECK"
39
+
40
+
41
+ DEFAULT_FRESHNESS_SCHEDULE_CHECK_TYPE = (
42
+ FreshnessAssertionScheduleCheckType.SINCE_THE_LAST_CHECK
43
+ )
44
+
45
+
46
+ def _parse_freshness_schedule_check_type(
47
+ schedule_check_type: Optional[
48
+ Union[
49
+ str,
50
+ FreshnessAssertionScheduleCheckType,
51
+ models.FreshnessAssertionScheduleTypeClass,
52
+ ]
53
+ ],
54
+ ) -> FreshnessAssertionScheduleCheckType:
55
+ """Parse the freshness schedule check type."""
56
+ if isinstance(schedule_check_type, FreshnessAssertionScheduleCheckType):
57
+ return schedule_check_type
58
+ if isinstance(schedule_check_type, models.FreshnessAssertionScheduleTypeClass):
59
+ return FreshnessAssertionScheduleCheckType(
60
+ _try_parse_and_validate_schema_classes_enum(
61
+ schedule_check_type, models.FreshnessAssertionScheduleTypeClass
62
+ )
63
+ )
64
+ if not schedule_check_type:
65
+ return DEFAULT_FRESHNESS_SCHEDULE_CHECK_TYPE
66
+
67
+ # Make string comparison case-insensitive
68
+ if isinstance(schedule_check_type, str):
69
+ schedule_check_type_upper = schedule_check_type.upper()
70
+ for member in FreshnessAssertionScheduleCheckType:
71
+ if member.value.upper() == schedule_check_type_upper:
72
+ return member
73
+ # If no match found, fall back to original behavior for error
74
+
75
+ return FreshnessAssertionScheduleCheckType(schedule_check_type)
76
+
77
+
78
+ class _FreshnessAssertionInput(_AssertionInput, _HasFreshnessFeatures):
79
+ def _assertion_type(self) -> str:
80
+ """Get the assertion type."""
81
+ return models.AssertionTypeClass.FRESHNESS
82
+
83
+ def __init__(
84
+ self,
85
+ *,
86
+ dataset_urn: Union[str, DatasetUrn],
87
+ entity_client: EntityClient, # Needed to get the schema field spec for the detection mechanism if needed
88
+ urn: Optional[Union[str, AssertionUrn]] = None,
89
+ display_name: Optional[str] = None,
90
+ enabled: bool = True,
91
+ schedule: Optional[Union[str, models.CronScheduleClass]] = None,
92
+ detection_mechanism: DetectionMechanismInputTypes = None,
93
+ incident_behavior: Optional[AssertionIncidentBehaviorInputTypes] = None,
94
+ tags: Optional[TagsInputType] = None,
95
+ created_by: Union[str, CorpUserUrn],
96
+ created_at: datetime,
97
+ updated_by: Union[str, CorpUserUrn],
98
+ updated_at: datetime,
99
+ freshness_schedule_check_type: Optional[
100
+ Union[
101
+ str,
102
+ FreshnessAssertionScheduleCheckType,
103
+ models.FreshnessAssertionScheduleTypeClass,
104
+ ]
105
+ ] = None,
106
+ lookback_window: Optional[TimeWindowSizeInputTypes] = None,
107
+ ):
108
+ _AssertionInput.__init__(
109
+ self,
110
+ dataset_urn=dataset_urn,
111
+ entity_client=entity_client,
112
+ urn=urn,
113
+ display_name=display_name,
114
+ enabled=enabled,
115
+ schedule=schedule,
116
+ detection_mechanism=detection_mechanism,
117
+ incident_behavior=incident_behavior,
118
+ tags=tags,
119
+ source_type=models.AssertionSourceTypeClass.NATIVE, # Native assertions are of type native, not inferred
120
+ created_by=created_by,
121
+ created_at=created_at,
122
+ updated_by=updated_by,
123
+ updated_at=updated_at,
124
+ )
125
+
126
+ self.freshness_schedule_check_type = _parse_freshness_schedule_check_type(
127
+ freshness_schedule_check_type
128
+ )
129
+ self.lookback_window = (
130
+ _try_parse_time_window_size(lookback_window) if lookback_window else None
131
+ )
132
+ self._validate_schedule_check_type()
133
+
134
+ def _validate_schedule_check_type(self) -> None:
135
+ """Validate the schedule check type."""
136
+ if self.freshness_schedule_check_type is None:
137
+ raise SDKUsageError("Freshness schedule check type is required.")
138
+ if (
139
+ self.freshness_schedule_check_type
140
+ == FreshnessAssertionScheduleCheckType.FIXED_INTERVAL
141
+ and self.lookback_window is None
142
+ ):
143
+ raise SDKUsageError(
144
+ "Fixed interval freshness assertions must have a lookback_window provided."
145
+ )
146
+ if (
147
+ self.freshness_schedule_check_type
148
+ == FreshnessAssertionScheduleCheckType.SINCE_THE_LAST_CHECK
149
+ and self.lookback_window is not None
150
+ ):
151
+ raise SDKUsageError(
152
+ "Since the last check freshness assertions cannot have a lookback_window provided."
153
+ )
154
+
155
+ def _create_monitor_info(
156
+ self,
157
+ assertion_urn: AssertionUrn,
158
+ status: models.MonitorStatusClass,
159
+ schedule: models.CronScheduleClass,
160
+ ) -> models.MonitorInfoClass:
161
+ """
162
+ Create a MonitorInfoClass with all the necessary components.
163
+ """
164
+ source_type, field = self._convert_assertion_source_type_and_field()
165
+ return models.MonitorInfoClass(
166
+ type=models.MonitorTypeClass.ASSERTION,
167
+ status=status,
168
+ assertionMonitor=models.AssertionMonitorClass(
169
+ assertions=[
170
+ models.AssertionEvaluationSpecClass(
171
+ assertion=str(assertion_urn),
172
+ schedule=schedule,
173
+ parameters=self._get_assertion_evaluation_parameters(
174
+ str(source_type), field
175
+ ),
176
+ )
177
+ ]
178
+ ),
179
+ )
180
+
181
+ def _create_assertion_info(
182
+ self, filter: Optional[models.DatasetFilterClass]
183
+ ) -> AssertionInfoInputType:
184
+ """
185
+ Create a FreshnessAssertionInfoClass for a freshness assertion.
186
+
187
+ Args:
188
+ filter: Optional filter to apply to the assertion. Only relevant for QUERY detection mechanism.
189
+
190
+ Returns:
191
+ A FreshnessAssertionInfoClass configured for freshness.
192
+ """
193
+ schedule = self._convert_schedule()
194
+ return models.FreshnessAssertionInfoClass(
195
+ type=models.FreshnessAssertionTypeClass.DATASET_CHANGE, # Currently only dataset change is supported
196
+ entity=str(self.dataset_urn),
197
+ schedule=models.FreshnessAssertionScheduleClass(
198
+ type=self.freshness_schedule_check_type
199
+ or models.FreshnessAssertionScheduleTypeClass.SINCE_THE_LAST_CHECK,
200
+ cron=models.FreshnessCronScheduleClass(
201
+ cron=schedule.cron,
202
+ timezone=schedule.timezone,
203
+ ),
204
+ fixedInterval=models.FixedIntervalScheduleClass(
205
+ multiple=self.lookback_window.multiple,
206
+ unit=self.lookback_window.unit,
207
+ )
208
+ if self.lookback_window
209
+ else None,
210
+ ),
211
+ filter=filter,
212
+ )
213
+
214
+ def _convert_schedule(self) -> models.CronScheduleClass:
215
+ """Create a schedule for a freshness assertion.
216
+
217
+ Returns:
218
+ A CronScheduleClass with appropriate schedule settings.
219
+ """
220
+ if self.schedule is None:
221
+ return DEFAULT_DAILY_SCHEDULE
222
+
223
+ return models.CronScheduleClass(
224
+ cron=self.schedule.cron,
225
+ timezone=self.schedule.timezone,
226
+ )
227
+
228
+ def _get_assertion_evaluation_parameters(
229
+ self, source_type: str, field: Optional[FieldSpecType]
230
+ ) -> models.AssertionEvaluationParametersClass:
231
+ # Ensure field is either None or FreshnessFieldSpecClass
232
+ freshness_field = None
233
+ if field is not None:
234
+ if not isinstance(field, models.FreshnessFieldSpecClass):
235
+ raise SDKUsageError(
236
+ f"Expected FreshnessFieldSpecClass for freshness assertion, got {type(field).__name__}"
237
+ )
238
+ freshness_field = field
239
+
240
+ return models.AssertionEvaluationParametersClass(
241
+ type=models.AssertionEvaluationParametersTypeClass.DATASET_FRESHNESS,
242
+ datasetFreshnessParameters=models.DatasetFreshnessAssertionParametersClass(
243
+ sourceType=source_type, field=freshness_field
244
+ ),
245
+ )
246
+
247
+ def _convert_assertion_source_type_and_field(
248
+ self,
249
+ ) -> tuple[str, Optional[FieldSpecType]]:
250
+ """
251
+ Convert detection mechanism into source type and field specification for freshness assertions.
252
+
253
+ Returns:
254
+ A tuple of (source_type, field) where field may be None.
255
+ Note that the source_type is a string, not a models.DatasetFreshnessSourceTypeClass (or other assertion source type) since
256
+ the source type is not a enum in the code generated from the DatasetFreshnessSourceType enum in the PDL.
257
+
258
+ Raises:
259
+ SDKNotYetSupportedError: If the detection mechanism is not supported.
260
+ SDKUsageError: If the field (column) is not found in the dataset,
261
+ and the detection mechanism requires a field. Also if the field
262
+ is not an allowed type for the detection mechanism.
263
+ """
264
+ source_type = models.DatasetFreshnessSourceTypeClass.INFORMATION_SCHEMA
265
+ field = None
266
+
267
+ if isinstance(self.detection_mechanism, _InformationSchema):
268
+ source_type = models.DatasetFreshnessSourceTypeClass.INFORMATION_SCHEMA
269
+ elif isinstance(self.detection_mechanism, _DataHubOperation):
270
+ source_type = models.DatasetFreshnessSourceTypeClass.DATAHUB_OPERATION
271
+ elif isinstance(self.detection_mechanism, _AuditLog):
272
+ source_type = models.DatasetFreshnessSourceTypeClass.AUDIT_LOG
273
+ elif isinstance(self.detection_mechanism, _LastModifiedColumn):
274
+ source_type = models.DatasetFreshnessSourceTypeClass.FIELD_VALUE
275
+ field = self._create_field_spec(
276
+ self.detection_mechanism.column_name,
277
+ LAST_MODIFIED_ALLOWED_FIELD_TYPES,
278
+ "last modified column",
279
+ models.FreshnessFieldKindClass.LAST_MODIFIED,
280
+ self._get_schema_field_spec,
281
+ self._validate_field_type,
282
+ )
283
+ elif isinstance(self.detection_mechanism, _HighWatermarkColumn):
284
+ if (
285
+ self.freshness_schedule_check_type
286
+ is models.FreshnessAssertionScheduleTypeClass.FIXED_INTERVAL
287
+ ):
288
+ raise SDKUsageError(
289
+ "Fixed interval freshness assertions cannot have a high watermark column provided."
290
+ )
291
+ source_type = models.DatasetFreshnessSourceTypeClass.FIELD_VALUE
292
+ field = self._create_field_spec(
293
+ self.detection_mechanism.column_name,
294
+ HIGH_WATERMARK_ALLOWED_FIELD_TYPES,
295
+ "high watermark column",
296
+ models.FreshnessFieldKindClass.HIGH_WATERMARK,
297
+ self._get_schema_field_spec,
298
+ self._validate_field_type,
299
+ )
300
+ else:
301
+ raise SDKNotYetSupportedError(
302
+ f"Detection mechanism {self.detection_mechanism} not yet supported for freshness assertions"
303
+ )
304
+
305
+ return source_type, field