Numeric indexes insted of columns names are now supported.
@@ -103,9 +103,11 @@ class TestKGTKFilter(unittest.TestCase):
subj_col=None, pred_col=None, obj_col=None, or_pattern=False,
invert=False, first_match_only=False, show_version=False)
- def test_kgtk_filter_missing_columns(self):
- with self.assertRaises(KGTKException):
+ def test_kgtk_filter_column_indexes(self):
run(input_file=Path(self.file_path2), output_files=[[Path(f'{self.temp_dir}/one_row.tsv')]],
reject_file=None, patterns=[["Q;P;O"]],
subj_col='1', pred_col='2', obj_col='3', or_pattern=False,
invert=False, first_match_only=False, show_version=False)
+ df = pd.read_csv(f'{self.temp_dir}/one_row.tsv', sep='\t')
+ self.assertEqual(len(df), 0)
+
