acryl-datahub-cloud 0.3.12rc3__py3-none-any.whl → 0.3.12rc5__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/datahub_forms_notifications/forms_notifications_source.py +37 -2
- acryl_datahub_cloud/metadata/schema.avsc +9 -0
- acryl_datahub_cloud/metadata/schemas/AssertionAnalyticsRunEvent.avsc +9 -0
- acryl_datahub_cloud/sdk/__init__.py +10 -2
- acryl_datahub_cloud/sdk/assertion/__init__.py +0 -0
- acryl_datahub_cloud/sdk/{assertion.py → assertion/assertion_base.py} +614 -231
- acryl_datahub_cloud/sdk/assertion/smart_column_metric_assertion.py +224 -0
- acryl_datahub_cloud/sdk/assertion/types.py +18 -0
- acryl_datahub_cloud/sdk/assertion_input/__init__.py +0 -0
- acryl_datahub_cloud/sdk/{assertion_input.py → assertion_input/assertion_input.py} +437 -147
- acryl_datahub_cloud/sdk/assertion_input/freshness_assertion_input.py +261 -0
- acryl_datahub_cloud/sdk/assertion_input/smart_column_metric_assertion_input.py +943 -0
- acryl_datahub_cloud/sdk/assertions_client.py +1281 -70
- acryl_datahub_cloud/sdk/entities/assertion.py +8 -1
- {acryl_datahub_cloud-0.3.12rc3.dist-info → acryl_datahub_cloud-0.3.12rc5.dist-info}/METADATA +41 -41
- {acryl_datahub_cloud-0.3.12rc3.dist-info → acryl_datahub_cloud-0.3.12rc5.dist-info}/RECORD +20 -14
- {acryl_datahub_cloud-0.3.12rc3.dist-info → acryl_datahub_cloud-0.3.12rc5.dist-info}/WHEEL +0 -0
- {acryl_datahub_cloud-0.3.12rc3.dist-info → acryl_datahub_cloud-0.3.12rc5.dist-info}/entry_points.txt +0 -0
- {acryl_datahub_cloud-0.3.12rc3.dist-info → acryl_datahub_cloud-0.3.12rc5.dist-info}/top_level.txt +0 -0
|
@@ -38,6 +38,7 @@ from datahub.metadata.schema_classes import (
|
|
|
38
38
|
FormNotificationDetailsClass,
|
|
39
39
|
FormNotificationEntryClass,
|
|
40
40
|
FormNotificationsClass,
|
|
41
|
+
FormSettingsClass,
|
|
41
42
|
FormStateClass,
|
|
42
43
|
FormTypeClass,
|
|
43
44
|
)
|
|
@@ -233,7 +234,8 @@ class DataHubFormsNotificationsSource(Source):
|
|
|
233
234
|
def get_forms(self) -> List[Tuple[str, FormInfoClass]]:
|
|
234
235
|
"""
|
|
235
236
|
Get forms and their formInfo aspect either from the forms provided in the config
|
|
236
|
-
or search for forms that are published and notifyAssigneesOnPublish = True
|
|
237
|
+
or search for forms that are published and notifyAssigneesOnPublish = True.
|
|
238
|
+
This method will only return forms that are published and have notifications enabled.
|
|
237
239
|
"""
|
|
238
240
|
form_urns = []
|
|
239
241
|
|
|
@@ -242,9 +244,42 @@ class DataHubFormsNotificationsSource(Source):
|
|
|
242
244
|
else:
|
|
243
245
|
form_urns = self.search_for_forms()
|
|
244
246
|
|
|
245
|
-
|
|
247
|
+
form_urns_with_notifications_enabled = (
|
|
248
|
+
self.get_form_urns_with_notifications_enabled(form_urns)
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
return self.get_form_infos(form_urns_with_notifications_enabled)
|
|
252
|
+
|
|
253
|
+
def get_form_urns_with_notifications_enabled(
|
|
254
|
+
self, form_urns: List[str]
|
|
255
|
+
) -> List[str]:
|
|
256
|
+
"""
|
|
257
|
+
Get formSettings aspects and check if notifications are enabled for a given form urn.
|
|
258
|
+
If notifications are enabled, add to filtered list and return.
|
|
259
|
+
"""
|
|
260
|
+
filtered_form_urns: List[str] = []
|
|
261
|
+
|
|
262
|
+
if len(form_urns) > 0:
|
|
263
|
+
entities = self.graph.get_entities("form", form_urns, ["formSettings"])
|
|
264
|
+
for urn, entity in entities.items():
|
|
265
|
+
form_tuple = entity.get(FormSettingsClass.ASPECT_NAME, (None, None))
|
|
266
|
+
if form_tuple and form_tuple[0]:
|
|
267
|
+
if not isinstance(form_tuple[0], FormSettingsClass):
|
|
268
|
+
logger.error(
|
|
269
|
+
f"{form_tuple[0]} is not of type FormInfo for urn: {urn}"
|
|
270
|
+
)
|
|
271
|
+
else:
|
|
272
|
+
form_settings = form_tuple[0]
|
|
273
|
+
if form_settings.notificationSettings.notifyAssigneesOnPublish:
|
|
274
|
+
filtered_form_urns.append(urn)
|
|
275
|
+
|
|
276
|
+
return filtered_form_urns
|
|
246
277
|
|
|
247
278
|
def get_form_infos(self, form_urns: List[str]) -> List[Tuple[str, FormInfoClass]]:
|
|
279
|
+
"""
|
|
280
|
+
Get formInfo aspects for a list of form urns and return the formInfos of forms
|
|
281
|
+
that are published. If a form is not published, we don't want to notify.
|
|
282
|
+
"""
|
|
248
283
|
form_infos: List[Tuple[str, FormInfoClass]] = []
|
|
249
284
|
|
|
250
285
|
if len(form_urns) > 0:
|
|
@@ -25793,6 +25793,7 @@
|
|
|
25793
25793
|
{
|
|
25794
25794
|
"Searchable": {
|
|
25795
25795
|
"/*": {
|
|
25796
|
+
"addToFilters": true,
|
|
25796
25797
|
"fieldType": "URN",
|
|
25797
25798
|
"hasValuesFieldName": "hasAsserteeDomain"
|
|
25798
25799
|
}
|
|
@@ -25812,6 +25813,7 @@
|
|
|
25812
25813
|
{
|
|
25813
25814
|
"Searchable": {
|
|
25814
25815
|
"/*": {
|
|
25816
|
+
"addToFilters": true,
|
|
25815
25817
|
"fieldType": "URN",
|
|
25816
25818
|
"hasValuesFieldName": "hasAsserteeDataProduct"
|
|
25817
25819
|
}
|
|
@@ -25831,6 +25833,7 @@
|
|
|
25831
25833
|
{
|
|
25832
25834
|
"Searchable": {
|
|
25833
25835
|
"/*": {
|
|
25836
|
+
"addToFilters": true,
|
|
25834
25837
|
"fieldType": "URN",
|
|
25835
25838
|
"hasValuesFieldName": "hasAsserteeTags"
|
|
25836
25839
|
}
|
|
@@ -25849,6 +25852,7 @@
|
|
|
25849
25852
|
{
|
|
25850
25853
|
"Searchable": {
|
|
25851
25854
|
"/*": {
|
|
25855
|
+
"addToFilters": true,
|
|
25852
25856
|
"fieldType": "URN",
|
|
25853
25857
|
"hasValuesFieldName": "hasAsserteeGlossaryTerms"
|
|
25854
25858
|
}
|
|
@@ -25868,6 +25872,7 @@
|
|
|
25868
25872
|
{
|
|
25869
25873
|
"Searchable": {
|
|
25870
25874
|
"/*": {
|
|
25875
|
+
"addToFilters": true,
|
|
25871
25876
|
"fieldType": "URN",
|
|
25872
25877
|
"hasValuesFieldName": "hasAsserteeOwners"
|
|
25873
25878
|
}
|
|
@@ -25886,6 +25891,7 @@
|
|
|
25886
25891
|
},
|
|
25887
25892
|
{
|
|
25888
25893
|
"Searchable": {
|
|
25894
|
+
"addToFilters": true,
|
|
25889
25895
|
"fieldType": "URN"
|
|
25890
25896
|
},
|
|
25891
25897
|
"TimeseriesField": {},
|
|
@@ -25903,6 +25909,7 @@
|
|
|
25903
25909
|
},
|
|
25904
25910
|
{
|
|
25905
25911
|
"Searchable": {
|
|
25912
|
+
"addToFilters": true,
|
|
25906
25913
|
"fieldType": "URN"
|
|
25907
25914
|
},
|
|
25908
25915
|
"TimeseriesField": {},
|
|
@@ -25921,6 +25928,7 @@
|
|
|
25921
25928
|
{
|
|
25922
25929
|
"Searchable": {
|
|
25923
25930
|
"/*": {
|
|
25931
|
+
"addToFilters": true,
|
|
25924
25932
|
"fieldType": "URN",
|
|
25925
25933
|
"hasValuesFieldName": "hasAsserteeSchemaFieldGlossaryTerms"
|
|
25926
25934
|
}
|
|
@@ -25940,6 +25948,7 @@
|
|
|
25940
25948
|
{
|
|
25941
25949
|
"Searchable": {
|
|
25942
25950
|
"/*": {
|
|
25951
|
+
"addToFilters": true,
|
|
25943
25952
|
"fieldType": "URN",
|
|
25944
25953
|
"hasValuesFieldName": "hasAsserteeSchemaFieldTags"
|
|
25945
25954
|
}
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
{
|
|
54
54
|
"Searchable": {
|
|
55
55
|
"/*": {
|
|
56
|
+
"addToFilters": true,
|
|
56
57
|
"fieldType": "URN",
|
|
57
58
|
"hasValuesFieldName": "hasAsserteeDomain"
|
|
58
59
|
}
|
|
@@ -72,6 +73,7 @@
|
|
|
72
73
|
{
|
|
73
74
|
"Searchable": {
|
|
74
75
|
"/*": {
|
|
76
|
+
"addToFilters": true,
|
|
75
77
|
"fieldType": "URN",
|
|
76
78
|
"hasValuesFieldName": "hasAsserteeDataProduct"
|
|
77
79
|
}
|
|
@@ -91,6 +93,7 @@
|
|
|
91
93
|
{
|
|
92
94
|
"Searchable": {
|
|
93
95
|
"/*": {
|
|
96
|
+
"addToFilters": true,
|
|
94
97
|
"fieldType": "URN",
|
|
95
98
|
"hasValuesFieldName": "hasAsserteeTags"
|
|
96
99
|
}
|
|
@@ -109,6 +112,7 @@
|
|
|
109
112
|
{
|
|
110
113
|
"Searchable": {
|
|
111
114
|
"/*": {
|
|
115
|
+
"addToFilters": true,
|
|
112
116
|
"fieldType": "URN",
|
|
113
117
|
"hasValuesFieldName": "hasAsserteeGlossaryTerms"
|
|
114
118
|
}
|
|
@@ -128,6 +132,7 @@
|
|
|
128
132
|
{
|
|
129
133
|
"Searchable": {
|
|
130
134
|
"/*": {
|
|
135
|
+
"addToFilters": true,
|
|
131
136
|
"fieldType": "URN",
|
|
132
137
|
"hasValuesFieldName": "hasAsserteeOwners"
|
|
133
138
|
}
|
|
@@ -146,6 +151,7 @@
|
|
|
146
151
|
},
|
|
147
152
|
{
|
|
148
153
|
"Searchable": {
|
|
154
|
+
"addToFilters": true,
|
|
149
155
|
"fieldType": "URN"
|
|
150
156
|
},
|
|
151
157
|
"TimeseriesField": {},
|
|
@@ -163,6 +169,7 @@
|
|
|
163
169
|
},
|
|
164
170
|
{
|
|
165
171
|
"Searchable": {
|
|
172
|
+
"addToFilters": true,
|
|
166
173
|
"fieldType": "URN"
|
|
167
174
|
},
|
|
168
175
|
"TimeseriesField": {},
|
|
@@ -181,6 +188,7 @@
|
|
|
181
188
|
{
|
|
182
189
|
"Searchable": {
|
|
183
190
|
"/*": {
|
|
191
|
+
"addToFilters": true,
|
|
184
192
|
"fieldType": "URN",
|
|
185
193
|
"hasValuesFieldName": "hasAsserteeSchemaFieldGlossaryTerms"
|
|
186
194
|
}
|
|
@@ -200,6 +208,7 @@
|
|
|
200
208
|
{
|
|
201
209
|
"Searchable": {
|
|
202
210
|
"/*": {
|
|
211
|
+
"addToFilters": true,
|
|
203
212
|
"fieldType": "URN",
|
|
204
213
|
"hasValuesFieldName": "hasAsserteeSchemaFieldTags"
|
|
205
214
|
}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
from acryl_datahub_cloud.sdk.assertion import (
|
|
1
|
+
from acryl_datahub_cloud.sdk.assertion.assertion_base import (
|
|
2
|
+
FreshnessAssertion,
|
|
2
3
|
SmartFreshnessAssertion,
|
|
3
4
|
SmartVolumeAssertion,
|
|
4
5
|
)
|
|
5
|
-
from acryl_datahub_cloud.sdk.
|
|
6
|
+
from acryl_datahub_cloud.sdk.assertion.smart_column_metric_assertion import (
|
|
7
|
+
SmartColumnMetricAssertion,
|
|
8
|
+
)
|
|
9
|
+
from acryl_datahub_cloud.sdk.assertion_input.assertion_input import (
|
|
6
10
|
AssertionIncidentBehavior,
|
|
7
11
|
DetectionMechanism,
|
|
8
12
|
FixedRangeExclusionWindow,
|
|
9
13
|
InferenceSensitivity,
|
|
14
|
+
TimeWindowSize,
|
|
10
15
|
)
|
|
11
16
|
from acryl_datahub_cloud.sdk.assertions_client import AssertionsClient
|
|
12
17
|
from acryl_datahub_cloud.sdk.resolver_client import ResolverClient
|
|
@@ -15,6 +20,9 @@ from acryl_datahub_cloud.sdk.subscription_client import SubscriptionClient
|
|
|
15
20
|
__all__ = [
|
|
16
21
|
"SmartFreshnessAssertion",
|
|
17
22
|
"SmartVolumeAssertion",
|
|
23
|
+
"SmartColumnMetricAssertion",
|
|
24
|
+
"TimeWindowSize",
|
|
25
|
+
"FreshnessAssertion",
|
|
18
26
|
"DetectionMechanism",
|
|
19
27
|
"InferenceSensitivity",
|
|
20
28
|
"FixedRangeExclusionWindow",
|
|
File without changes
|