Skip to content

Commit 67c171c

Browse files
committed
chore: add fallback
1 parent ffba9c5 commit 67c171c

2 files changed

Lines changed: 19 additions & 5 deletions

File tree

pyatlan/generator/templates/methods/asset/alpha__d_q_rule.jinja2

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
@classmethod
2+
@classmethod
33
@init_guid
44
def custom_sql_creator(
55
cls,
@@ -153,7 +153,7 @@
153153
if results.count == 1:
154154
asset_for_validation = results.current_page()[0]
155155

156-
threshold_compare_operator = (
156+
validated_threshold_operator = (
157157
alpha_DQRule.Attributes._validate_template_features(
158158
rule_type,
159159
rule_conditions,
@@ -164,12 +164,18 @@
164164
)
165165
)
166166

167+
final_threshold_compare_operator = (
168+
validated_threshold_operator
169+
or threshold_compare_operator
170+
or alpha_DQRuleThresholdCompareOperator.LESS_THAN_EQUAL
171+
)
172+
167173
attributes = alpha_DQRule.Attributes.creator(
168174
client=client,
169175
rule_type=rule_type,
170176
asset=asset,
171177
column=column,
172-
threshold_compare_operator=threshold_compare_operator,
178+
threshold_compare_operator=final_threshold_compare_operator,
173179
threshold_value=threshold_value,
174180
alert_priority=alert_priority,
175181
threshold_unit=threshold_unit,
@@ -288,6 +294,7 @@
288294
validated_threshold_operator
289295
or threshold_compare_operator
290296
or retrieved_threshold_compare_operator
297+
or alpha_DQRuleThresholdCompareOperator.LESS_THAN_EQUAL
291298
)
292299

293300
config_arguments_raw = alpha_DQRule.Attributes._generate_config_arguments_raw(

pyatlan/model/assets/core/alpha__d_q_rule.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def column_level_rule_creator(
201201
if results.count == 1:
202202
asset_for_validation = results.current_page()[0]
203203

204-
threshold_compare_operator = (
204+
validated_threshold_operator = (
205205
alpha_DQRule.Attributes._validate_template_features(
206206
rule_type,
207207
rule_conditions,
@@ -212,12 +212,18 @@ def column_level_rule_creator(
212212
)
213213
)
214214

215+
final_threshold_compare_operator = (
216+
validated_threshold_operator
217+
or threshold_compare_operator
218+
or alpha_DQRuleThresholdCompareOperator.LESS_THAN_EQUAL
219+
)
220+
215221
attributes = alpha_DQRule.Attributes.creator(
216222
client=client,
217223
rule_type=rule_type,
218224
asset=asset,
219225
column=column,
220-
threshold_compare_operator=threshold_compare_operator,
226+
threshold_compare_operator=final_threshold_compare_operator,
221227
threshold_value=threshold_value,
222228
alert_priority=alert_priority,
223229
threshold_unit=threshold_unit,
@@ -336,6 +342,7 @@ def updater(
336342
validated_threshold_operator
337343
or threshold_compare_operator
338344
or retrieved_threshold_compare_operator
345+
or alpha_DQRuleThresholdCompareOperator.LESS_THAN_EQUAL
339346
)
340347

341348
config_arguments_raw = alpha_DQRule.Attributes._generate_config_arguments_raw(

0 commit comments

Comments
 (0)