@@ -289,8 +289,8 @@ def updater(
289289 retrieved_column = search_result .alpha_dq_rule_base_column # type: ignore[attr-defined]
290290 retrieved_alert_priority = search_result .alpha_dq_rule_alert_priority # type: ignore[attr-defined]
291291 retrieved_row_scope_filtering_enabled = (
292- search_result .alpha_dq_rule_row_scope_filtering_enabled
293- ) # type: ignore[attr-defined]
292+ search_result .alpha_dq_rule_row_scope_filtering_enabled # type: ignore[attr-defined]
293+ )
294294 retrieved_description = search_result .user_description
295295 retrieved_asset = search_result .alpha_dq_rule_base_dataset # type: ignore[attr-defined]
296296 retrieved_template_rule_name = search_result .alpha_dq_rule_template_name # type: ignore[attr-defined]
@@ -332,12 +332,18 @@ def updater(
332332 )
333333 )
334334
335+ final_compare_operator = (
336+ validated_threshold_operator
337+ or threshold_compare_operator
338+ or retrieved_threshold_compare_operator
339+ )
340+
335341 config_arguments_raw = alpha_DQRule .Attributes ._generate_config_arguments_raw (
336342 is_alert_enabled = True ,
337343 custom_sql = custom_sql or retrieved_custom_sql ,
338344 display_name = rule_name or retrieved_rule_name ,
339345 dimension = dimension or retrieved_dimension ,
340- compare_operator = validated_threshold_operator ,
346+ compare_operator = final_compare_operator ,
341347 threshold_value = threshold_value or retrieved_threshold_value ,
342348 threshold_unit = threshold_unit or retrieved_threshold_unit ,
343349 column = retrieved_column ,
@@ -351,7 +357,7 @@ def updater(
351357 name = "" ,
352358 alpha_dq_rule_config_arguments = alpha_DQRuleConfigArguments (
353359 alpha_dq_rule_threshold_object = alpha_DQRuleThresholdObject (
354- alpha_dq_rule_threshold_compare_operator = validated_threshold_operator ,
360+ alpha_dq_rule_threshold_compare_operator = final_compare_operator ,
355361 alpha_dq_rule_threshold_value = threshold_value
356362 or retrieved_threshold_value ,
357363 alpha_dq_rule_threshold_unit = threshold_unit
@@ -1085,7 +1091,9 @@ class Attributes(DataQuality.Attributes):
10851091
10861092 @staticmethod
10871093 def _get_template_config_value (
1088- config_value : str , property_name : str = None , value_key : str = "default"
1094+ config_value : str ,
1095+ property_name : Optional [str ] = None ,
1096+ value_key : str = "default" ,
10891097 ):
10901098 if not config_value :
10911099 return None
@@ -1112,9 +1120,9 @@ def _validate_template_features(
11121120 alpha_DQRuleThresholdCompareOperator
11131121 ] = None ,
11141122 asset : Optional [Asset ] = None ,
1115- ) -> alpha_DQRuleThresholdCompareOperator :
1123+ ) -> Optional [ alpha_DQRuleThresholdCompareOperator ] :
11161124 if not template_config or not template_config .get ("config" ):
1117- return
1125+ return None
11181126
11191127 config = template_config ["config" ]
11201128
@@ -1147,7 +1155,7 @@ def _validate_template_features(
11471155 if rule_conditions :
11481156 allowed_rule_conditions = (
11491157 alpha_DQRule .Attributes ._get_template_config_value (
1150- config .alpha_dq_rule_template_config_rule_conditions ,
1158+ config .alpha_dq_rule_template_config_rule_conditions or "" ,
11511159 None ,
11521160 "enum" ,
11531161 )
0 commit comments