def apply_rules( self, rule_file: Dict ) -> None: """ Apply rules to the dataset. Will ignore any field where manuallyMapped is set to YES. args: - rule_file: path to the rule file returns: N/A Note - See rules/rules.py for further information """ r = Rules(rule_file) for row in self._data: #add output headers for output_header in _REQ_OUTPUT_HEADERS: if output_header not in row.keys(): row[output_header] = "" self._std_header_map[output_header] = output_header #add manuallyMapped if 'manuallymapped'not in row.keys(): row['manuallymapped'] = '' self._std_header_map['manuallymapped'] = "manuallymapped" #skip manuallyMapped rows if row['manuallymapped'] == 'YES': continue #apply rules else: r.ApplyRules(row)
def apply_rules(self, rule_file: Dict) -> None: """ Apply rules to the dataset. Will ignore any field where manuallyMapped is set to YES. args: - rule_file: path to the rule file returns: N/A Note - See rules/rules.py for further information """ r = Rules(rule_file) for row in self._data: if row['manuallyMapped'] == 'YES': continue else: r.ApplyRules(row)