acryl-datahub-cloud 0.3.12rc8__py3-none-any.whl → 0.3.12rc10__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_reporting/datahub_form_reporting.py +29 -13
- acryl_datahub_cloud/metadata/schema.avsc +9 -0
- acryl_datahub_cloud/metadata/schemas/UsageFeatures.avsc +9 -0
- acryl_datahub_cloud/sdk/assertion_input/assertion_input.py +8 -10
- acryl_datahub_cloud/sdk/assertion_input/freshness_assertion_input.py +2 -4
- acryl_datahub_cloud/sdk/assertion_input/smart_column_metric_assertion_input.py +3 -5
- acryl_datahub_cloud/sdk/assertion_input/sql_assertion_input.py +2 -4
- acryl_datahub_cloud/sdk/assertion_input/volume_assertion_input.py +2 -4
- acryl_datahub_cloud/sdk/assertions_client.py +163 -411
- {acryl_datahub_cloud-0.3.12rc8.dist-info → acryl_datahub_cloud-0.3.12rc10.dist-info}/METADATA +37 -37
- {acryl_datahub_cloud-0.3.12rc8.dist-info → acryl_datahub_cloud-0.3.12rc10.dist-info}/RECORD +15 -15
- {acryl_datahub_cloud-0.3.12rc8.dist-info → acryl_datahub_cloud-0.3.12rc10.dist-info}/WHEEL +0 -0
- {acryl_datahub_cloud-0.3.12rc8.dist-info → acryl_datahub_cloud-0.3.12rc10.dist-info}/entry_points.txt +0 -0
- {acryl_datahub_cloud-0.3.12rc8.dist-info → acryl_datahub_cloud-0.3.12rc10.dist-info}/top_level.txt +0 -0
|
@@ -10,7 +10,7 @@ from pydantic import BaseModel
|
|
|
10
10
|
from acryl_datahub_cloud.elasticsearch.graph_service import BaseModelRow
|
|
11
11
|
from datahub.emitter.mcp import MetadataChangeProposalWrapper
|
|
12
12
|
from datahub.ingestion.graph.client import DataHubGraph
|
|
13
|
-
from datahub.ingestion.graph.filters import
|
|
13
|
+
from datahub.ingestion.graph.filters import RawSearchFilter
|
|
14
14
|
from datahub.metadata.schema_classes import (
|
|
15
15
|
DomainPropertiesClass,
|
|
16
16
|
FormAssociationClass,
|
|
@@ -149,7 +149,7 @@ class DataHubFormReportingData(FormData):
|
|
|
149
149
|
)
|
|
150
150
|
)
|
|
151
151
|
|
|
152
|
-
def get_form_existence_or_filters(self) ->
|
|
152
|
+
def get_form_existence_or_filters(self) -> RawSearchFilter:
|
|
153
153
|
"""
|
|
154
154
|
Datasets must either have completedForms or incompleteForms assigned to
|
|
155
155
|
them
|
|
@@ -157,25 +157,41 @@ class DataHubFormReportingData(FormData):
|
|
|
157
157
|
if self.allowed_forms:
|
|
158
158
|
return [
|
|
159
159
|
{
|
|
160
|
-
"
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
"and": [
|
|
161
|
+
{
|
|
162
|
+
"field": "completedForms",
|
|
163
|
+
"condition": "EQUAL",
|
|
164
|
+
"values": self.allowed_forms,
|
|
165
|
+
}
|
|
166
|
+
]
|
|
163
167
|
},
|
|
164
168
|
{
|
|
165
|
-
"
|
|
166
|
-
|
|
167
|
-
|
|
169
|
+
"and": [
|
|
170
|
+
{
|
|
171
|
+
"field": "incompleteForms",
|
|
172
|
+
"condition": "EQUAL",
|
|
173
|
+
"values": self.allowed_forms,
|
|
174
|
+
}
|
|
175
|
+
]
|
|
168
176
|
},
|
|
169
177
|
]
|
|
170
178
|
else:
|
|
171
179
|
return [
|
|
172
180
|
{
|
|
173
|
-
"
|
|
174
|
-
|
|
181
|
+
"and": [
|
|
182
|
+
{
|
|
183
|
+
"field": "completedForms",
|
|
184
|
+
"condition": "EXISTS",
|
|
185
|
+
}
|
|
186
|
+
]
|
|
175
187
|
},
|
|
176
188
|
{
|
|
177
|
-
"
|
|
178
|
-
|
|
189
|
+
"and": [
|
|
190
|
+
{
|
|
191
|
+
"field": "incompleteForms",
|
|
192
|
+
"condition": "EXISTS",
|
|
193
|
+
}
|
|
194
|
+
]
|
|
179
195
|
},
|
|
180
196
|
]
|
|
181
197
|
|
|
@@ -293,7 +309,7 @@ class DataHubFormReportingData(FormData):
|
|
|
293
309
|
extra_fields = [f for f in self.DataHubDatasetSearchRow.__fields__]
|
|
294
310
|
# TODO: Replace with the new search/filter SDK.
|
|
295
311
|
result = self.graph.get_results_by_filter(
|
|
296
|
-
extra_or_filters=
|
|
312
|
+
extra_or_filters=self.get_form_existence_or_filters(),
|
|
297
313
|
extra_source_fields=extra_fields,
|
|
298
314
|
skip_cache=True,
|
|
299
315
|
)
|
|
@@ -14983,6 +14983,15 @@
|
|
|
14983
14983
|
"doc": "Overall rank of the dataset based on the the last 30 days insert/update operation count on a platform\nIt returns one plus the number of rows proceeding or equals to the current row in the ordering. "
|
|
14984
14984
|
},
|
|
14985
14985
|
{
|
|
14986
|
+
"Searchable": {
|
|
14987
|
+
"/*": {
|
|
14988
|
+
"addToFilters": true,
|
|
14989
|
+
"fieldName": "topUsersLast30Days",
|
|
14990
|
+
"fieldType": "URN",
|
|
14991
|
+
"filterNameOverride": "Top users last 30 days",
|
|
14992
|
+
"hasValuesFieldName": "hasTopUsersLast30Days"
|
|
14993
|
+
}
|
|
14994
|
+
},
|
|
14986
14995
|
"Urn": "Urn",
|
|
14987
14996
|
"urn_is_array": true,
|
|
14988
14997
|
"type": [
|
|
@@ -160,6 +160,15 @@
|
|
|
160
160
|
"doc": "Overall rank of the dataset based on the the last 30 days insert/update operation count on a platform\nIt returns one plus the number of rows proceeding or equals to the current row in the ordering. "
|
|
161
161
|
},
|
|
162
162
|
{
|
|
163
|
+
"Searchable": {
|
|
164
|
+
"/*": {
|
|
165
|
+
"addToFilters": true,
|
|
166
|
+
"fieldName": "topUsersLast30Days",
|
|
167
|
+
"fieldType": "URN",
|
|
168
|
+
"filterNameOverride": "Top users last 30 days",
|
|
169
|
+
"hasValuesFieldName": "hasTopUsersLast30Days"
|
|
170
|
+
}
|
|
171
|
+
},
|
|
163
172
|
"type": [
|
|
164
173
|
"null",
|
|
165
174
|
{
|
|
@@ -911,9 +911,7 @@ class _AssertionInput(ABC):
|
|
|
911
911
|
enabled: bool = True,
|
|
912
912
|
schedule: Optional[Union[str, models.CronScheduleClass]] = None,
|
|
913
913
|
detection_mechanism: DetectionMechanismInputTypes = None,
|
|
914
|
-
incident_behavior: Optional[
|
|
915
|
-
Union[AssertionIncidentBehavior, list[AssertionIncidentBehavior]]
|
|
916
|
-
] = None,
|
|
914
|
+
incident_behavior: Optional[AssertionIncidentBehaviorInputTypes] = None,
|
|
917
915
|
tags: Optional[TagsInputType] = None,
|
|
918
916
|
source_type: str = models.AssertionSourceTypeClass.NATIVE, # Verified on init to be a valid enum value
|
|
919
917
|
created_by: Union[str, CorpUserUrn],
|
|
@@ -932,7 +930,11 @@ class _AssertionInput(ABC):
|
|
|
932
930
|
display_name: The display name of the assertion. If not provided, a random display name will be generated.
|
|
933
931
|
enabled: Whether the assertion is enabled. Defaults to True.
|
|
934
932
|
detection_mechanism: The detection mechanism to be used for the assertion.
|
|
935
|
-
incident_behavior: The incident behavior to be applied to the assertion.
|
|
933
|
+
incident_behavior: The incident behavior to be applied to the assertion. Accepts:
|
|
934
|
+
- String values: "raise_on_fail", "resolve_on_pass"
|
|
935
|
+
- Enum values: AssertionIncidentBehavior.RAISE_ON_FAIL, AssertionIncidentBehavior.RESOLVE_ON_PASS
|
|
936
|
+
- Lists of any of the above values
|
|
937
|
+
- None (default behavior)
|
|
936
938
|
tags: The tags to be applied to the assertion.
|
|
937
939
|
source_type: The source type of the assertion. Defaults to models.AssertionSourceTypeClass.NATIVE.
|
|
938
940
|
created_by: The actor that created the assertion.
|
|
@@ -1321,9 +1323,7 @@ class _SmartFreshnessAssertionInput(
|
|
|
1321
1323
|
sensitivity: Optional[Union[str, InferenceSensitivity]] = None,
|
|
1322
1324
|
exclusion_windows: Optional[ExclusionWindowInputTypes] = None,
|
|
1323
1325
|
training_data_lookback_days: Optional[int] = None,
|
|
1324
|
-
incident_behavior: Optional[
|
|
1325
|
-
Union[AssertionIncidentBehavior, list[AssertionIncidentBehavior]]
|
|
1326
|
-
] = None,
|
|
1326
|
+
incident_behavior: Optional[AssertionIncidentBehaviorInputTypes] = None,
|
|
1327
1327
|
tags: Optional[TagsInputType] = None,
|
|
1328
1328
|
created_by: Union[str, CorpUserUrn],
|
|
1329
1329
|
created_at: datetime,
|
|
@@ -1504,9 +1504,7 @@ class _SmartVolumeAssertionInput(_AssertionInput, _HasSmartAssertionInputs):
|
|
|
1504
1504
|
sensitivity: Optional[Union[str, InferenceSensitivity]] = None,
|
|
1505
1505
|
exclusion_windows: Optional[ExclusionWindowInputTypes] = None,
|
|
1506
1506
|
training_data_lookback_days: Optional[int] = None,
|
|
1507
|
-
incident_behavior: Optional[
|
|
1508
|
-
Union[AssertionIncidentBehavior, list[AssertionIncidentBehavior]]
|
|
1509
|
-
] = None,
|
|
1507
|
+
incident_behavior: Optional[AssertionIncidentBehaviorInputTypes] = None,
|
|
1510
1508
|
tags: Optional[TagsInputType] = None,
|
|
1511
1509
|
created_by: Union[str, CorpUserUrn],
|
|
1512
1510
|
created_at: datetime,
|
|
@@ -5,7 +5,7 @@ from acryl_datahub_cloud.sdk.assertion_input.assertion_input import (
|
|
|
5
5
|
DEFAULT_DAILY_SCHEDULE,
|
|
6
6
|
HIGH_WATERMARK_ALLOWED_FIELD_TYPES,
|
|
7
7
|
LAST_MODIFIED_ALLOWED_FIELD_TYPES,
|
|
8
|
-
|
|
8
|
+
AssertionIncidentBehaviorInputTypes,
|
|
9
9
|
DetectionMechanismInputTypes,
|
|
10
10
|
FieldSpecType,
|
|
11
11
|
TimeWindowSizeInputTypes,
|
|
@@ -49,9 +49,7 @@ class _FreshnessAssertionInput(_AssertionInput, _HasFreshnessFeatures):
|
|
|
49
49
|
enabled: bool = True,
|
|
50
50
|
schedule: Optional[Union[str, models.CronScheduleClass]] = None,
|
|
51
51
|
detection_mechanism: DetectionMechanismInputTypes = None,
|
|
52
|
-
incident_behavior: Optional[
|
|
53
|
-
Union[AssertionIncidentBehavior, list[AssertionIncidentBehavior]]
|
|
54
|
-
] = None,
|
|
52
|
+
incident_behavior: Optional[AssertionIncidentBehaviorInputTypes] = None,
|
|
55
53
|
tags: Optional[TagsInputType] = None,
|
|
56
54
|
created_by: Union[str, CorpUserUrn],
|
|
57
55
|
created_at: datetime,
|
|
@@ -8,7 +8,7 @@ from acryl_datahub_cloud.sdk.assertion_input.assertion_input import (
|
|
|
8
8
|
NO_PARAMETER_OPERATORS,
|
|
9
9
|
RANGE_OPERATORS,
|
|
10
10
|
SINGLE_VALUE_OPERATORS,
|
|
11
|
-
|
|
11
|
+
AssertionIncidentBehaviorInputTypes,
|
|
12
12
|
AssertionInfoInputType,
|
|
13
13
|
DetectionMechanismInputTypes,
|
|
14
14
|
ExclusionWindowInputTypes,
|
|
@@ -282,9 +282,7 @@ class _SmartColumnMetricAssertionInput(_AssertionInput, _HasSmartAssertionInputs
|
|
|
282
282
|
sensitivity: Optional[Union[str, InferenceSensitivity]] = None,
|
|
283
283
|
exclusion_windows: Optional[ExclusionWindowInputTypes] = None,
|
|
284
284
|
training_data_lookback_days: Optional[int] = None,
|
|
285
|
-
incident_behavior: Optional[
|
|
286
|
-
Union[AssertionIncidentBehavior, list[AssertionIncidentBehavior]]
|
|
287
|
-
] = None,
|
|
285
|
+
incident_behavior: Optional[AssertionIncidentBehaviorInputTypes] = None,
|
|
288
286
|
tags: Optional[TagsInputType] = None,
|
|
289
287
|
created_by: Union[str, CorpUserUrn],
|
|
290
288
|
created_at: datetime,
|
|
@@ -312,7 +310,7 @@ class _SmartColumnMetricAssertionInput(_AssertionInput, _HasSmartAssertionInputs
|
|
|
312
310
|
sensitivity: The sensitivity of the assertion.
|
|
313
311
|
exclusion_windows: The exclusion windows of the assertion.
|
|
314
312
|
training_data_lookback_days: The training data lookback days of the assertion.
|
|
315
|
-
incident_behavior: The incident behavior of the assertion.
|
|
313
|
+
incident_behavior: The incident behavior of the assertion. Accepts strings, enum values, lists, or None.
|
|
316
314
|
tags: The tags of the assertion.
|
|
317
315
|
created_by: The creator of the assertion.
|
|
318
316
|
created_at: The creation time of the assertion.
|
|
@@ -8,7 +8,7 @@ from acryl_datahub_cloud.sdk.assertion_input.assertion_input import (
|
|
|
8
8
|
DEFAULT_EVERY_SIX_HOURS_SCHEDULE,
|
|
9
9
|
RANGE_OPERATORS,
|
|
10
10
|
SINGLE_VALUE_NUMERIC_OPERATORS,
|
|
11
|
-
|
|
11
|
+
AssertionIncidentBehaviorInputTypes,
|
|
12
12
|
FieldSpecType,
|
|
13
13
|
_AssertionInput,
|
|
14
14
|
_try_parse_and_validate_schema_classes_enum,
|
|
@@ -162,9 +162,7 @@ class _SqlAssertionInput(_AssertionInput):
|
|
|
162
162
|
display_name: Optional[str] = None,
|
|
163
163
|
enabled: bool = True,
|
|
164
164
|
schedule: Optional[Union[str, models.CronScheduleClass]] = None,
|
|
165
|
-
incident_behavior: Optional[
|
|
166
|
-
Union[AssertionIncidentBehavior, list[AssertionIncidentBehavior]]
|
|
167
|
-
] = None,
|
|
165
|
+
incident_behavior: Optional[AssertionIncidentBehaviorInputTypes] = None,
|
|
168
166
|
tags: Optional[TagsInputType] = None,
|
|
169
167
|
created_by: Union[str, CorpUserUrn],
|
|
170
168
|
created_at: datetime,
|
|
@@ -7,7 +7,7 @@ from pydantic import BaseModel, Extra
|
|
|
7
7
|
|
|
8
8
|
from acryl_datahub_cloud.sdk.assertion_input.assertion_input import (
|
|
9
9
|
DEFAULT_EVERY_SIX_HOURS_SCHEDULE,
|
|
10
|
-
|
|
10
|
+
AssertionIncidentBehaviorInputTypes,
|
|
11
11
|
DetectionMechanismInputTypes,
|
|
12
12
|
FieldSpecType,
|
|
13
13
|
_AssertionInput,
|
|
@@ -530,9 +530,7 @@ class _VolumeAssertionInput(_AssertionInput):
|
|
|
530
530
|
enabled: bool = True,
|
|
531
531
|
schedule: Optional[Union[str, models.CronScheduleClass]] = None,
|
|
532
532
|
detection_mechanism: DetectionMechanismInputTypes = None,
|
|
533
|
-
incident_behavior: Optional[
|
|
534
|
-
Union[AssertionIncidentBehavior, list[AssertionIncidentBehavior]]
|
|
535
|
-
] = None,
|
|
533
|
+
incident_behavior: Optional[AssertionIncidentBehaviorInputTypes] = None,
|
|
536
534
|
tags: Optional[TagsInputType] = None,
|
|
537
535
|
created_by: Union[str, CorpUserUrn],
|
|
538
536
|
created_at: datetime,
|