Skip to content

Commit 45beb9b

Browse files
committed
Added the raw config argument generator
1 parent c630198 commit 45beb9b

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

pyatlan/model/assets/core/alpha__d_q_rule.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
alpha_DQRuleAlertPriority,
1616
alpha_DQRuleStatus,
1717
alpha_DQSourceSyncStatus,
18+
alpha_DQRuleThresholdCompareOperator,
19+
alpha_DQRuleThresholdUnit
1820
)
1921
from pyatlan.model.fields.atlan_fields import (
2022
KeywordField,
@@ -24,12 +26,47 @@
2426
TextField,
2527
)
2628
from pyatlan.model.structs import alpha_DQRuleConfigArguments
29+
import json
2730

2831
from .data_quality import DataQuality
2932

3033

3134
class alpha_DQRule(DataQuality):
3235
"""Description"""
36+
@classmethod
37+
def _generate_config_arguments_raw(
38+
*,
39+
is_alert_enabled: bool = True,
40+
custom_sql: Optional[str] = None,
41+
display_name: Optional[str] = None,
42+
dimension: Optional[alpha_DQDimension] = None,
43+
compare_operator: alpha_DQRuleThresholdCompareOperator,
44+
threshold_value: int,
45+
threshold_unit: Optional[alpha_DQRuleThresholdUnit] = None,
46+
dq_priority: alpha_DQRuleAlertPriority,
47+
) -> str:
48+
49+
config = {
50+
"isAlertEnabled": is_alert_enabled,
51+
"alpha_dqRuleTemplateConfigThresholdObject": {
52+
"alpha_dqRuleTemplateConfigThresholdCompareOperator": compare_operator,
53+
"alpha_dqRuleTemplateConfigThresholdValue": threshold_value,
54+
"alpha_dqRuleTemplateConfigThresholdUnit": threshold_unit,
55+
},
56+
"alpha_dqRuleTemplateAdvancedSettings.dqPriority": dq_priority,
57+
}
58+
59+
if custom_sql is not None:
60+
config["alpha_dqRuleTemplateConfigCustomSQL"] = custom_sql
61+
62+
if display_name is not None:
63+
config["alpha_dqRuleTemplateConfigDisplayName"] = display_name
64+
65+
if dimension is not None:
66+
config["alpha_dqRuleTemplateConfigDimension"] = dimension
67+
68+
69+
return json.dumps(config)
3370

3471
type_name: str = Field(default="alpha_DQRule", allow_mutation=False)
3572

pyatlan/model/enums.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2970,3 +2970,8 @@ class alpha_DQSourceSyncStatus(str, Enum):
29702970
FAILURE = "FAILURE"
29712971
IN_PROGRESS = "IN_PROGRESS"
29722972
WAITING_FOR_SCHEDULE = "WAITING_FOR_SCHEDULE"
2973+
2974+
class alpha_DQRuleThresholdCompareOperator(str, Enum):
2975+
GREATER_THAN_EQUAL = "GTE"
2976+
LESS_THAN_EQUAL = "LTE"
2977+
EQUAL = "EQ"

0 commit comments

Comments
 (0)