Skip to content

Commit

Permalink
cleaning up status and log statements
Browse files Browse the repository at this point in the history
  • Loading branch information
PhillipsOwen committed Nov 8, 2022
1 parent 9b3fd17 commit dd38452
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/common/rule_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,6 @@ def check_by_age(self, rule: Rule, entity_details: namedtuple):
# the data value for age is in days
target_age = rule.query_data_value

self.logger.debug("Current age: %s, Rule predicate: %s, target age: %s", current_age, rule.predicate_type, target_age)

# make the EQUALS comparison
if rule.predicate_type == PredicateType.EQUALS:
# compare the age vs. the age to trigger the rule
Expand Down Expand Up @@ -379,6 +377,9 @@ def check_by_age(self, rule: Rule, entity_details: namedtuple):
else:
self.logger.error("Error: Unspecified predicate type.")

self.logger.info("%s - Current age: %s, Rule predicate: %s, target age: %s", 'Success' if ret_val else 'Failed.', current_age,
rule.predicate_type, target_age)

# return to the caller
return ret_val

Expand Down Expand Up @@ -409,8 +410,8 @@ def convert_to_enum_types(rule: dict) -> namedtuple:
:return:
"""
# convert values that are enum types
rule['query_criteria_type'] = QueryCriteriaType[rule['query_criteria_type']] \
if rule['query_criteria_type'] is not None else QueryCriteriaType.NONE
rule['query_criteria_type'] = QueryCriteriaType[rule['query_criteria_type']] if rule['query_criteria_type'] is not None \
else QueryCriteriaType.NONE

rule['query_data_type'] = QueryDataType[rule['query_data_type']] if rule['query_data_type'] is not None else QueryDataType.NONE
rule['predicate_type'] = PredicateType[rule['predicate_type']] if rule['predicate_type'] is not None else PredicateType.NONE
Expand Down

0 comments on commit dd38452

Please sign in to comment.